10.5: Remove the 'downloaded file' warning flag

Nov 09, '07 07:30:00AM

Contributed by: Anonymous

A Vista-esque feature of OS X 10.5 is that it tags web downloads (not just those from Safari) as such, and then warns you about running downloaded apps. Archived (e.g. zipped) files inherit the tags from their tagged container. This is an annoyance to power users, but, being a power user, I can do something about it. ;)

Save the following script (original source) in ~/Library/Scripts/Folder Action Scripts. You'll probably need to create the Scripts directory and its subdirectory, e.g. with mkdir -p ~/Library/Scripts/Folder Action Scripts:

"Unquarantine" by Henrik Nyh <http://henrik.nyh.se/2007/10/lift-the-leopard-download-quarantine>
This Folder Action handler is triggered whenever items are added to the attached folder.
It gets rid of Leopard's annoying "this application was downloaded from the Internet" warnings by stripping the "quarantine" property.

on adding folder items to thisFolder after receiving addedItems
  repeat with anItem in addedItems
    set anItem's contents to (quoted form of POSIX path of (anItem as alias))
  end repeat
  set AppleScript's text item delimiters to " "
  do shell script "xattr -d com.apple.quarantine " & (addedItems as text)
end adding folder items to

Now navigate to ~/Downloads, or wherever your downloads go. Control-click on the folder in question, then select More » Configure Folder Actions. Check Enable Folder Actions, then Attach the Unquarantine script you saved earlier0 to the folder. And that should be it.

Note that, quite obviously, the folder action only applies to that folder. If you download a file to a directory without this folder action attached, Leopard is free to nag again. (You can read the original version of this post on my blog.)

Comments (42)

Mac OS X Hints