Disabling” Launch Services File Quarantine

From your noodle to other noodles. Talk about ways to get the most from Hazel. Even exchange recipes for the cool rules you've thought up. DO NOT POST YOUR QUESTIONS HERE.

Moderators: Mr_Noodle, Moderators

Disabling” Launch Services File Quarantine 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"
do shell script "xattr -d com.apple.quarantine $1"
end tell

Anyone's help would be much appreciated.

Background Info:
Posts: 8
Joined: Sun Sep 20, 2009 8:51 pm

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.
Site Admin
Posts: 8571
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Ya. I was literally just jumping back onto the forum to write that I was mistakenly using shell script instead of AppleScript.
Posts: 8
Joined: Sun Sep 20, 2009 8:51 pm

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.

Posts: 8
Joined: Sun Sep 20, 2009 8:51 pm

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))
Posts: 8
Joined: Sun Sep 20, 2009 8:51 pm

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:

Posts: 3
Joined: Wed Sep 16, 2009 5:39 am

Re: Disabling” Launch Services File Quarantine 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.
Posts: 8
Joined: Sun Sep 20, 2009 8:51 pm

Thanks Dan - that solution worked perfectly. Saved me major headaches.
Posts: 4
Joined: Mon Oct 12, 2009 10:56 pm

Return to Tips & Tricks - DO NOT POST QUESTIONS