zip multiple files individually
i recently had need to be able to zip a quantity of files individually. enough to warrant finding an automated way of doing it, too
open automator, and create a new custom (blank) worfklow. select the utilities entry in the left-most column, the drag the run shell script action into the blank work area on the right.
set the pass Input pop-up to “as arguments,” and then replace the existing cat code with this text:
save the script as an application, and then just drag and drop multiple files (not a folder full of files, though), onto the resulting automator app icon.
open automator, and create a new custom (blank) worfklow. select the utilities entry in the left-most column, the drag the run shell script action into the blank work area on the right.
set the pass Input pop-up to “as arguments,” and then replace the existing cat code with this text:
for f in "$@"
do
zip -j "$f.zip" "$f"
done
save the script as an application, and then just drag and drop multiple files (not a folder full of files, though), onto the resulting automator app icon.
Comments
one issue i found with this (tao found it, actually), was that when uncompressing a file, it has a directory hirachy matching that (kind of) of where the files where prior to zipping.
so, if the files are all at root when you zip them, uncompressing the resulting archive results in the original file.
if they are on your desktop in a folder, uncompressing the archive will result in something like... if anyone knows of a non-cludge workaround, don't hesitate to let us know, innit!
But if you want to look for other flags to use, to see if they help... type:
zip --h
And it will give you the available options
Edit, yes it does
i dunno why it's happening, really.