Can't get xattr to work inside Hazel shell script

I'm trying to strip the quarantine flag from certain files using Hazel. I tried
in the shell script action and I kept getting "Error processing shell script" with no additional information. All the log says is "2012-03-23 11:56:48.700 hazelworker[26761] [Error] Shell script failed: Error processing shell script on file /Users/Shared/Documents/Finance/Data/Bank Downloads/20120323114957-onlineeast3.bankofamerica.com.qfx."
So I found another thread on here where someone was using xattr, and you gave them this script:
Using that, the error is gone and the script finishes, but the flag is still not removed. I don't understand why, because if I run the "xattr -d com.apple.quarantine" command with the file name in Terminal, it works fine.
Any help you could give would be appreciated. I'm running Hazel 3.0.3 on OS X 10.7.3, Hazel is only installed as my user.
- Code: Select all
xattr -d com.apple.quarantine "$1"
in the shell script action and I kept getting "Error processing shell script" with no additional information. All the log says is "2012-03-23 11:56:48.700 hazelworker[26761] [Error] Shell script failed: Error processing shell script on file /Users/Shared/Documents/Finance/Data/Bank Downloads/20120323114957-onlineeast3.bankofamerica.com.qfx."
So I found another thread on here where someone was using xattr, and you gave them this script:
- Code: Select all
attr="com.apple.quarantine"
output=`xattr "$1" | grep "$attr"`
if [ -n "$output" ]; then
xattr -d "$attr" "$1"
fi
Using that, the error is gone and the script finishes, but the flag is still not removed. I don't understand why, because if I run the "xattr -d com.apple.quarantine" command with the file name in Terminal, it works fine.
Any help you could give would be appreciated. I'm running Hazel 3.0.3 on OS X 10.7.3, Hazel is only installed as my user.