Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Create Windows-compatible zip files via AppleScript' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Create Windows-compatible zip files via AppleScript
Authored by: nickdynamite on Sep 07, '05 04:17:20PM

i get an odd error when i try to use this on more then 1 file selected - used the script from the original hint - is there a way to rewrite the script for say 2 items or more? and have that new .zip file be called "Archive.zip" by default just like the contextual menu item "Create Archive" does?



[ Reply to This | # ]
this will make Archive.zip
Authored by: davehole on Sep 07, '05 06:41:05PM
Can be used on one or more selected files. If more than one file is selected it creates an "Archive.zip" folder Like previous hint, make an automator "run shell script" action with shell set to "/bin/sh" and pass input as "arguments".


if [ $# == 1 ]; then
        zip -r -j "$1.zip" $1 -x \*.DS_Store
else
        x=`dirname $1`
        zip -r -j ${x}/Archive.zip $* -x \*.DS_Store
fi


[ Reply to This | # ]