save the workflow as a finder selection and select a folder full of files you wish to individually compress, and it works but yes unfortunately it still makes it have that annoying files structure, which i personally can't stand, and also it doesn't seem to like working with other folders within folders and it can't seem to compress. In the automator place action "get selected finder items"įollowed by "run shell script" : keep the shell as /bin/bash and the pass input as "to stdin" the actual script is This seems to work, but it only works if you select an entire folder and run the automator scrpt from there, otherwise if you select individual files it actually searches each file for folders and zips the files within the "package contents" : so workflow looks like this: (The original files aren't touched by the script, so there's no danger of losing them.) However, I didn't test every file type nor every possible usage scenario. I ran a number of files through the compression and then expanded them again, and they all seemed to work.
If you're going to use this in a critical process, I suggest testing it extensively first. In particular, if there's a way to structure this so it works with folders as well as files, I'd be interested in seeing how that works. If you have a better way of doing this (that won't require the user to use Terminal), please post in the comments. If you'd rather have the archives expand into their current directory, change the zip command above to this: Note that zip will include full directory structure information by default, so when you unzip the new archive, the files will each expand into a series of folders (created as necessary) that match where they were originally found.
#Mac zip multiple files not in a folder archive#
A new archive named "" will be created for each file in the selection. In the contextual menu, choose Automator » Zip individually (or whatever you named it).
To use the workflow, select a number of files (this workflow will not work with folders!) and then control-click on the selection. That's it select File » Save as Plug-in, name your plug-in ( Zip individually or whatever), and make sure the 'Plug-in for' pop-up is set to Finder. Leave the shell set to /bin/bash, and set the Pass Input pop-up to as arguments. Launch Automator, and drag the Automator » Run Shell Script action into the work area. In OS X, if you select a number of files and use the Create Archive command, it compresses all those files into one large archive.Īfter a bit of work in Terminal and Automator, I came up with a simple one-step Automator Finder plug-in to enable this "zip into separate archives" functionality. A user over on the Macworld forums wanted to compress a number of individual files into separate zip archives.