I have written about Leopards Quarantine flag for downloaded files some weeks ago.

During the research in those days i have found a nice idea by Henrik using folder Actions to solve that issue. Read here how he solved it.

I have tweaked his Folder Actions Script a little bit. Basicaly i have just added Growl Support. You can find the Folder Script Ignorantenprogramm here.

Ok, if you are new to Folder Actions that might sound like a way over your head, but it isn’t. Lets take a look how to use it.

Installation:

  • Download Ignoratenprogramm.scpt
  • Open Finder and goto “/Users/yourUsername/Library”
  • Create a folder “Scripts” if it is not already there
  • Open that new Scripts folder
  • Create a new folder “Folder Action Scripts”
  • Save Ignorantenprogramm to this new folder

Installation is done. To get Ignorantenprogramm working you need to define an Action Folder now.

Configure Folder Action:

  • Right-click the desired Folder (most likely your Download Folder)
  • Select “More”
  • Select “Configure Folder Actions”
  • Select your Download folder in the folder-column of Folder Action Setup window
  • Choose Ignorantenprogramm as script in the script column of Folder Action Setup window
  • Close the dialog

Using:

Now lets make a test.

Download a new file to your Download Folder. If the download has finished you should see a Growl notification that the quarantine flag of this file is ignored now.

The final test:

Open that new file and see if you still see the Mac OS X Leopard quarantine question.

Hope you enjoy it.

Edit: forgot to poste the code

Code:


– Ignorantenprogramm

– Description:
– * Ignoratenprogramm is an appleScript based Folder Action

– Function:
– Ignoratenprogramm deletes the quarantine flag of files stored into an folder
– using this Folder Action.

– basic idea:
– http://henrik.nyh.se/2007/10/lift-the-leopard-download-quarantine

on adding folder items to thisFolder after receiving addedItems

– repeat
repeat with anItem in addedItems
set anItem’s contents to (quoted form of POSIX path of (anItem as alias))
end repeat

– define
set AppleScript’s text item delimiters to ” ”

– save path as string
set myPath to addedItems as text

– run ignore command
do shell script “xattr -d com.apple.quarantine ” & myPath

– Output using Growl
try
tell application “GrowlHelperApp”
set the allNotificationsList to  ¬
{”Test Notification”}
set the enabledNotificationsList to  ¬
{”Test Notification”}
(register as application  ¬
“Ignorantenprogramm” all notifications allNotificationsList  ¬
default notifications enabledNotificationsList  ¬
) notify with name  ¬
“Test Notification” title  ¬
“Ignorantenrogramm” description  ¬
“quarantine niformation of file: ” & myPath & ” ignored.” application name “Ignorantenprogramm”
end tell
on error
– Problem using growl
display dialog “Ignorantenprogramm had problems using Growl with file: ” & myPath with title “Ignorant” with icon 1 buttons {”Ok”} giving up after 5
end try
end adding folder items to

Yeah that wasn’t that much work, but i was curious how easy it would be to use it myself. Guess my AppleScript focus should be back to Tierprogramm now.

Need more examples about using Folder Actions ? Check this link

Share on Social Sites:
  • Digg
  • del.icio.us
  • Google
  • Technorati
  • Yigg
  • MisterWong
  • StumbleUpon

Similar Posts:
Leave a Reply