- The RAR Extractor is a Mac program that you can use to decompress files with all major archive formats including Rar, Zip, Tar, 7zip, Gzip, Bzip2, XZ, Tar.gz, bz2, iso, pkg, swf, exe, jar, xip, dms, and more. The application supports opening password-protected archive files and with batch-extraction, you can decompress several archived files.
- Locate the files or folders you want to archive using Mac Finder. Select the files you want to zip, and right click on their selection.
- If more than one file is being zipped, the archive will be named 'Archive.zip', and if multiple archives are created, they will be named successively 'Archive 2.zip' and so on. This works in all versions of Mac OS X, and you can access the compress item option from a right-click with a mouse, control-click with keyboard, or two-finger.
Click here to return to the 'Zip multiple files into individual archives via Automator' hint |
for folders, try the -r option ..
zip -r '$f' $f'
from the man page -- a little confusing that the args are 'foo' and 'foo'. the first arg is turned into 'foo.zip' .. the second arg is the file spec (of files which will be placed into the .zip)
~~~
To zip up an entire directory, the command:
zip -r foo foo
creates the archive foo.zip, containing all the files and direc-
tories in the directory foo that is contained within the current
directory.
~~~
Print Multiple Files via Finder. To use the Finder method to print multiple files at once on your Mac, first launch a new Finder window. You can do this by clicking on the Finder icon in your Dock.
Okay I must be doing something wrong because I did try to mix this hint (zip individual files) with the folder argument and it's not working...
I try both:
--
for f in '$@'
do
zip -r '$f' $f'
done
--
and
--
for f in '$@'
do
zip -r '$f.zip' '$f'
done
--
whitout any luck... :( I must admit I'm not used to play with Automator and Run Shell Script...
Never mind.
I just tried the script for individual files with folders selected and it work just the same (~/foo/bar with foo selected become ~/foo.zip). Doh!
Okay, one last thing... ;)
When I zip a folder with this script, let's say /foo from the Desktop level (~/Desktop/foo),
everything is working fine, i.e. it gives me a file named foo.zip at the same level as my original /foo folder (~/Desktop/foo).
The problem is when I unzip it. I end up with nested folders, i.e. /Users/MyUserName/Desktop/foo on the ~/Desktop folder. Is there a way to not include all those (almost empty) folders in the script?
The idea would be to make the script behave just like the 'Create Archive of...' in the contextual menu
---
www.automatorworld.com
'Better Living Through Macintosh Scripting'
IMHO it is better to just throw them in a folder and zip the folder. It's my pet peeve when a bunch of files unzip and end up all over the place as individual files. I'd rather unzip them into a nice folder.
---
The Apotek
http://theapotek.com
The Executioner's Summary:
http://www.last.fm/label/Broken+Hill+Music/playlists/6761?autostart
Sorry, does not seem to work. Added .zip to two places and it would partially work.
However, what would be nice is to have the workflow go like this:
Set up: single file on desktop, folder on desktop with some files in it and another folder in it with some more file (i.e. a level 2)
Now, results: run the work flow and have it zip the single file. Next, it would zip the folder and the subfolder. This does not happen now - no second level.
Also, would like to stip the path out of the zip file just to the folder level. For the single file a -j seems to work. However, how do you get the file path to just start at the folder being zipped, not at the user/desktop/etc level when unzipping?
Can this be done?
- Handles both files and directories
- Uses bzip2 instead of zip (better compression)
- Files are replaced by original_filename.bz2
- Directories are replaced by original_directoryname.tar.bz2
- In the event of an error, the original is not deleted
- File names are quoted properly to take into consideration embedded blanks which would mess up other solutions I've seen
I would love it if this action worked, it would be perfect as i agree, i would like the extra compression afforded by it, however it simply does not work. . . do you think you could go over exactly what i should do in the automator terminal? as in should it be '/bin/bash' and 'asas arguments' ? also i copied your code exactly and pasted it in the script box, perhaps i was supposed to do something else as well? thanks.
So many years have gone by and I still haven't found any better script to what our script does!
There is only one problem, when applied through Automator (on 10.6.8 or 10.5) is crashes after it compresses the 1st folder. Do you any idea why or if there is anything one can do to avoid this problem?
Zip File Format Mac
Chas, you are missing the point.
Let's say you have a game emulator and you have 1500 roms. The emulator accepts .zip and if you zip all of the roms you save a significant amount of space.
Zipping all of the files into a single zip will not work as the emulator will probably only load the first file in the zip.
This hint is very useful for us emu geeks.
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:
in the automator place action 'get selected finder items'
followed by 'get folder contents'
followed by 'run shell script' : keep the shell as /bin/bash and the pass input as 'to stdin' the actual script is
xargs -I {} zip {}.zip {}
that's it. 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 .apps very well, lastly i would like to have the option to individually select groups of files from within a folder and zip those.i dunno what's up with that. so maybe someone can take this script and flesh it out? :)
thanks, useful tip.
does anyone know a way to get around the directory structure... at the moment i have to dump my folders in the root dir to avoid the problems unzipping.
Chas, you are missing the point.
Let's say you have a game emulator and you have 1500 roms. The emulator accepts .zip and if you zip all of the roms you save a significant amount of space.
Zipping all of the files into a single zip will not work as the emulator will probably only load the first file in the zip.
This hint is very useful for us emu geeks.
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:
in the automator place action 'get selected finder items'
followed by 'get folder contents'
followed by 'run shell script' : keep the shell as /bin/bash and the pass input as 'to stdin' the actual script is
xargs -I {} zip {}.zip {}
that's it. 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 .apps very well, lastly i would like to have the option to individually select groups of files from within a folder and zip those.i dunno what's up with that. so maybe someone can take this script and flesh it out? :)
thanks, useful tip.
does anyone know a way to get around the directory structure... at the moment i have to dump my folders in the root dir to avoid the problems unzipping.
Zip Multiple Files Mac Terminal
and what if you want to encrypt each file with the same password?
just adding the -e-argument fails for obvious reasons.. so how?
http://discussions.apple.com/message.jspa?messageID=7079445
found this tip via Google. you have no idea how much time you just saved me.
i actually prefer using Terminal/Shell for zipping files...some people with older Windows systems seem to struggle with zip files made on a Mac and using the shell helps.
Remo ZIP Pro version:
Zip Multiple Files Together
Remo ZIP is also available in a Pro Edition, providing you with more sophisticated features:
- Ability to create compressed files of more than 4 GB
- Compress a single file or multiple files into a ZIP file within few seconds
- Secure your .rzip and .zip file with password protection
- Supports Standard, AES Encryption 128-Bit, 192-Bit and 256-Bit encryption
To purchase or upgrade Remo ZIP to Pro version click here.
Why File Compression is needed?
How To Zip Multiple Files Mac
As said above, file compression reduces the overall size of your files when compared to before compressing them. Some of the core reasons for file compression are:
- Reduce the Storage Space: Compressed files utilize less storage space. That is when you compress a file, the file size after compressing will reduce by 20% to 90% when compared to the uncompressed formats. Hence, in order to reduce the storage space and manage the available memory space effectively, you need to compress the files.
- Easy File Transfer: While sending large sized file through net, some email clients may have size limitations and thus, doesn't allow you to send them, thus you can compress the files accordingly and send your file.
- Minimized Transfer Time: When you have numerous files to be sent online, you will have to attach and send each file separately. With Remo ZIP software you can easily compress all these files into a single compressed and archived folder and send all the files at once with one single command, thus minimizing the transfer time.
- Reduces the risk of corruption: Sending all the files in an uncompressed format will increase the risk of corrupting or damaging your files. Hence, with compression you can easily and securely transfer your files.