While I love working on a Mac, I really hate the fact that you don't have an option to remove Mac-specific files from the zip file created by Finder's Create Archive. I often find myself creating an archive on the Mac only to have to open it with WinZip on the PC so I can take out the hidden dot files (e.g .DS_Store).
So I hacked up this code for the small little archives I create for my website. The code isn't perfect, but I'm sure someone can clean it up and put in some better error trapping.
-- Script name: WinZipMe
-- zip command options: -r = recursive,
-- -j = junk path (similar to Create Archive)
tell application "Finder"
-- Note: There's no extensive error trapping on this script
-- (e.g. folder counts for larger folders to show warnings)
-- You could also take off any .xxx suffix before adding
-- the file to the .zip if needed
set theItem to selection as alias
set itemPath to quoted form of POSIX path of theItem
set fileName to name of theItem
set theFolder to POSIX path of (container of theItem as alias)
set zipFile to quoted form of (theFolder & fileName & ".zip")
do shell script "zip -r -j " & zipFile & " " & itemPath
-- delay 1 -- this may be needed (and adjusted) for larger folders?
try -- We don't need to say anything if there are no .DS_Store files
do shell script "zip -d " & zipFile & " '*.DS_Store'"
end try
end tell
Wouldn't it be great if holding down the Option key while choosing Create Archive would exclude the special hidden Mac dot files?
Mac OS X Hints
http://hints.macworld.com/article.php?story=20050902030458181