Manipulations of selected file in Forklift: clueless as to how to even start

Basically, I want to write a macro which acts on the selected file in Forklift in the following order

  • rename (add date time stamp)
  • copy to folder A
  • move to folder B

I have been playing around with variables, tokens, etc and it's a disaster.
I would be grateful if someone could give me an overview of the actions used to do so.
thanks in advance for your time and help

Is there any way of getting a reference to "the selected file" out of Forklift? I'm pretty sure it doesn't support AppleScript...

If you can't find a way to do that then you've pretty much hit a dead end.

1 Like

ForkLift has a very small AppleScript dictionary, but the app does have a File > Copy Path command that would probably let you do whatever you need to do. In rough form, I'd try to do it this way:

  1. Manually select the file of interest in ForkLift.
  2. Activate macro.
  3. Macro formats the date stamp you want to use, saves it in a variable.
  4. KM: Commands > Rename in ForkLift.
  5. KM: Send left arrow to move to start of filename
  6. KM: Insert text by typing: %Variable%YourDateStampvar%
  7. KM: Send Return to commit filename
  8. KM: File > Copy Path in ForkLift, save to variable.
  9. KM: Copy file using variable with path as source, set new copy's name
  10. KM: Move file using variable with path source, set new destination

In theory, that should work well, but obviously I haven't tested it. Unknown: How does ForkLift react if you move a file outside of its environment?

-rob.

1 Like

thank you both very much @griffman @Nige_S

What I basically did not understand is that the macro has to be a mix of Forklift commands and KM actions. With that in mind and following @griffman 's instructions very well written step by step, it was an easy task and works perfectly.

Screenshot (click to expand/collapse)

2 Likes

Well, it wouldn't have had to be if ForkLift were scriptable (more so than it seems to be, anyway). Using KM to replace what wasn't possible by interacting with ForkLift seemed like an easy workaround; glad it worked for you.

EDIT: Based on something Peter said in another thread somewhere, you shouldn't need the clipboard seed stuff. He said that the Copy action waits for the clipboard to change before proceeding, so there was no need to do such checks.

-rob.

1 Like

I use KM and Forklift. However, if i wanted to automate renaming any file I would use Hazel which also includes copy and move commands. Its just much easier.

As an aside I note that Forklift doesn’t really facilitate moving files around your local directory and beyond which does seem to be a bit of a limitation for a file manager! I created a heap of services to move files to specific locations, These services could be intergrated into a KM workflow in need.

1 Like

thank you @Atlas for your interesting post.

I used to use Hazel quite a lot and had more than 30 rules. All was fine until one day disaster stuck for some bizarre reason that I never elucidated. It was a nightmare. Files moved, disappeared, renamed, etc automatically, which caused me to be immunized against Hazel except for basic actions like notifications or opening PDFs when files are downloaded.

I should have added to my post that I can also trigger the macro by Finder quick action and drag and drop.

It's your first time here, so welcome to the forum. There are some brilliant people like @griffman @Nige_S @noisneil @cdthomer @ccstone @tiffle @Airy and many others including obviously @peternlewis (my apologies to those I forgot) who are very patient and taught me a huge amount about KM.

1 Like

Oh bad luck re Hazel. I never had a problem with Hazel apart from my own incompetence! KM is where I try to have all my automations, but in addition to services, (given my skills) I did find it easier to create "Move to Folder" workflows for Forklift in Alfred. In passing, ... Forklift seems to be a niche product because I have seen minimal comment about it, and ways users are exploiting it.

1 Like

I use Alfred less. I find that as soon as things get a bit complicated, they transition to json scripts which defeats the purpose of constructing workflows. I also find that KM palettes are much easier to work with as the number of macros ↑ where as Alfred becomes overloaded and messy (just my opinion). I am not arguing. I am just saying that I regret the amount of time spent on Hazel (pre-disaster) and Alfred, and now stick to KM whenever possible.
That being said, I often use Alfred to search for a file and folder → trigger a file action. For that, it is superb. Launchbar also has some strong points for URL management.

2 Likes