One of the more popular posts on this site is an entry from October of 2007 on creating a ZIP archive and setting the modification date via an Automator workflow.
As I wrote then:
“…when you’re archiving older data, it’s much more useful for the ZIP file date to reflect the date of its contents, since a few years from now you probably won’t care when you compressed the stuff, but rather how old the files inside are.”
With Mac OS 10.6 Snow Leopard, this same workflow can be set up to run as a service, accessible from the context menu in any Finder window. The process is essentially the same as described in the original post, with the following adjustments:
To create the workflow,
/Applications/Automator.app, select the Service template and click Choose.
- At the top of the workflow area on the right side of the window, change the first list option to files or folders.
- From the Finder library, drag the Create Archive action to the workflow area. In the action settings, specify the default name and location for the archive file. (I prefer the same name & folder as the input, but you can set the Options to prompt for this information when the workflow runs.)
- From the Automator library, add the Run Shell Script action.
Leave the Shell set to
/bin/bash, set Pass input to
as arguments, and replace the default script in the text box with
zip -o "$@".
Save the workflow as a service, and you can run it on files & folders in the Finder by Control-clicking and choosing your new command from the Services submenu in the shortcut menu.
Note: To create a service that will set the date for existing ZIP files, skip Step 3 above.