File version management is one of the most important tenets of an efficient, sane post-production workflow. That's why most of the apps we use for our work have built-in tools for "increment and save" or scanning for new versions of an asset. Which makes it pretty odd that I haven't universally quashed this minor annoyance with some simple automation.
Primarily, when I need to version-up a file in Finder, I'm hitting CMD+D
, deleting "copy" from the end of the file name and then manually incrementing the version number by typing. What am I, a farmer?
Bound to a hyperkey shortcut, this Keyboard Maestro macro makes it super quick to version up a selection of files in Finder.
Steps
- Get the selection of files in Finder
- Split the file path into three pieces: everything before the version number, the version number, and everything after the version number
- Drop the "v" from the version number. It's cleaner.
- Increment the version number with two-digit number padding
- Assemble the new file path and name
- Copy the original file to its new destination
An Improvement
One thing I don't love about this macro is that it uses rigid two-digit number padding for the version number, no matter the padding on the original file. A factor of the way Keyboard Maestro variables and calculations work.
As much as I disagree with using more than two digits in a file version number, consistency and predictability are far more important to me. So, after a quick chat with the folks over on the Keyboard Maestro forum, I swapped out the "Set Variable to Calculation" action in Step 4 with the following actions, suggested by The Keyboard Maestro himself, Peter N Lewis:
- Replace all digits in the version number variable with zeros to create a "padding format"
- Build the calculation with KM Variables and our new padding format
- Evaluate the calculation
If this change seems overly-complicated and nearly identical to the original version of the macro, it is. The reason we're doing it this way is that the "Set Variable to Calculation" action does not currently support tokens in the "Format" parameter (though Peter says that's fixed in the next version). Building our own calculation formula out of variables and evaluating that formula with a Filter action is functionally the same, but with the extra flexibility we needed. Neat.