Created
April 29, 2021 22:04
-
-
Save Neradoc/6bc4ddcbd492d7a65a2dddb2e151c3ac to your computer and use it in GitHub Desktop.
Unquarantien downloaded files on macos with an applescript droplet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
loosely based on "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. | |
Now also runs as a droplet or a standalone application if, like me, you juste need sometimes to stop the madenning dialog to appear for every file of a downloaded (unzipped) zip archive. | |
*) | |
on adding folder items to thisFolder after receiving addedItems | |
my unQuarantine(addedItems) | |
end adding folder items to | |
on open (drops) | |
my unQuarantine(drops) | |
end open | |
on run | |
set result to choose folder with prompt "Select files to unquarantine" with multiple selections allowed | |
my unQuarantine(result) | |
end run | |
on unQuarantine(theItems) | |
repeat with anItem in theItems | |
set itemPath to (quoted form of POSIX path of (anItem as alias)) | |
do shell script "xattr -r -d com.apple.quarantine " & itemPath | |
end repeat | |
end unQuarantine |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment