Page 1 of 1

Removing __MACOSX from Zip Files

PostPosted: Sun Oct 19, 2014 2:24 pm
by Gigamesh
Hello,

I am trying to use the following script to remove the "__MACOSX" files from zip files. These files show up in the zips when seen in Windows and creates some problems with an application there.

The script I am using is fairly simple. I have run it in Terminal and it works.

Code: Select all
zip -d $1 \*__MACOSX*


Each time I run it, I get:

2014-10-19 14:12:00.534 hazelworker[22537] [Error] Shell script failed: Error processing shell script on file Chronicles 001.zip.
2014-10-19 14:12:00.534 hazelworker[22537] Shellscript exited with non-successful status code: 12

I have tried the following:

1. /usr/bin/zip in the command. Just to make sure it was finding zip.
2. Uninstalled and re-installed Hazel for all users. I had read this might help.
3. Variations of the string to remove. The different variations work in Terminal, but not in Hazel
4. Changing the shell. I've used bash and sh so far.



Regardless, none of the things I am trying have worked. Any suggestions would help.

Re: Removing __MACOSX from Zip Files

PostPosted: Mon Oct 20, 2014 10:18 am
by Mr_Noodle
First thing, put double quotes around $1 as it will fail if there are any spaces in the path. If that doesn't fix it, turn on debug mode which will show any output from the script.