Page 1 of 1

Disabling” Launch Services File Quarantine

PostPosted: Sun Sep 20, 2009 9:04 pm
by Spydi
Has anyone written a workflow to remove the warning that you receive from downloading files from the internet. This dialog is a one of Leopard’s new security features called “File Quarantine” and is primarily designed to protect users from trojan horse attacks. Any application that may download file content from the Internet can tag them as being “quarantined” to indicate that the it may be from an untrustworthy source. The problem is that files that I download commonly always have this warning popping up and its a pain for my hazel rules to open the files because they either get stuck because the warning comes up or the warning doesn't show up everytime and the program just stalls out.

I'm currently trying to do it by specifying extensions that are safe then running an applescript, but I think I have an error in my applescript.

tell application "Terminal"
activate
do shell script "xattr -d com.apple.quarantine $1"
end tell

Anyone's help would be much appreciated.

Background Info:
http://henrik.nyh.se/2007/10/lift-the-leopard-download-quarantine
http://theappleblog.com/2008/03/26/disabling-launch-services-file-quarantine/

Re: Disabling” Launch Services File Quarantine

PostPosted: Sun Sep 20, 2009 9:07 pm
by Mr_Noodle
If you are telling AppleScript to do a shell script, you might as well just do a shell script directly. Note that $1 doesn't mean anything in AppleScript. "theFile" refers to the file. Even though yes, you are invoking an AppleScript, AS has to interpret the argument first and then transfer it to the script.

So, easy way: copy and paste the stuff in the quotes and put it in a shell script.

Hard way: Take the file and replace the $1 with whatever value it has.

Re: Disabling” Launch Services File Quarantine

PostPosted: Sun Sep 20, 2009 9:16 pm
by Spydi
Ya. I was literally just jumping back onto the forum to write that I was mistakenly using shell script instead of AppleScript.

Re: Disabling” Launch Services File Quarantine

PostPosted: Sun Sep 20, 2009 9:33 pm
by Spydi
Ok so now I've revised the AppleScript to be:
do shell script "xattr -d com.apple.quarantine" & theFile

I keep getting an error. As you can tell I'm not well versed in AppleScript, but if someone can help me it would be greatly appreciated.

Thanks.

Re: Disabling” Launch Services File Quarantine

PostPosted: Sun Sep 20, 2009 9:52 pm
by Spydi
Figured it out finally. Just thought I'd share my results.

For my AppleScript I ended up having to use the following:
Code: Select all
do shell script "xattr -d com.apple.quarantine" & space & (quoted form of (POSIX path of theFile))

Re: Disabling” Launch Services File Quarantine

PostPosted: Fri Sep 25, 2009 9:53 am
by Lotusshaney
You dont need an Applescript.

Add a Run Shell Script action, chose embedded script, enter the shell as /bin/bash and in the script box enter

xattr -d com.apple.quarantine "$1"

This works fine and no nasty applescript needed :wink:

Dan

Re: Disabling” Launch Services File Quarantine

PostPosted: Fri Sep 25, 2009 11:49 am
by Spydi
Thanks Dan. I'll try this update one out and see how it works. Seems a bit more streamlined.

Re: Disabling” Launch Services File Quarantine

PostPosted: Mon Oct 12, 2009 11:00 pm
by Hieronymus_N
Thanks Dan - that solution worked perfectly. Saved me major headaches.