Getting rid of web page warning - Opening web pages stored on drive

Hi all,

I sometimes save web pages to the desktop (safari or FF) - whenever I double click to open one - I always get a dialog … are you sure you want to open this web app…?

  • ok - now this folder action script below now works for 10.6

Now - I’d like to be able to create an applescript APP so I can drop a folder on the app icon and it will process the contents of the folder ( rather than a folder action )

Question: I’m a fairly newbie AS person - how do I set this code to recognize whatever folder was dropped on it and process the contents?

I’m sure the change is to : on adding folder items to thisFolder after receiving addedItems ??? but what is it exactly?

Thanks in advance - Dave


(*
Unquarantine folder items etc.
*)

(* original came from …
“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 -r com.apple.quarantine " & (addedItems as text)

end adding folder items to

Use “on open” for drop applications. Something like this might work for you…

on open theItems
	-- theItems is a list of the dropped items
	-- we in this script I'll only use the first item in that list
	set firstDroppedItem to item 1 of theItems
	
	tell application "Finder"
		set folderItems to (items of firstDroppedItem) as alias list
	end tell
	repeat with aFolderItem in folderItems
		-- do something with aFolderItem
	end repeat
end open

Let’s add it just in case, but defaults write com.apple.LaunchServices LSQuarantine -bool no
disables those is an application downloaded from the internet warnings permanently.

(That example looks like it was copied from 10.5: Remove the ‘downloaded file’ warning flag - Mac OS X Hints, and it doesn’t seem to be mentioned there.)

Hi, regulus6633

I am trying the code below - trying to use you idea - however the error says
xattr: no such file and then seems to list the individual words of the file independently - like each was it’s own file. This newbie can’t tell what is wrong any ideas?

like:

xattr: no such file (path) and This
xattr: no such file (no path) and Is
xattr: no such file (no path) and A
xattr: no such file (no path) and Test


on open theItems
	-- theItems is a list of the dropped items
	-- we in this script I'll only use the first item in that list
	set firstDroppedItem to item 1 of theItems
	
	tell application "Finder"
		set folderItems to (items of firstDroppedItem) as alias list
	end tell
	repeat with aFolderItem in folderItems
		-- do something with aFolderItem
		--do shell script "xattr -d -r com.apple.quarantine " & (addedItems as text)
		--defaults write com.apple.LaunchServices LSQuarantine -bool no
		do shell script "xattr -d -r com.apple.quarantine " & (aFolderItem as text)
		
	end repeat
end open

Also I added the source info to the original thread above _ (was just trying to keep the text short)

Use this line in place of yours…

do shell script "xattr -d -r com.apple.quarantine " & quoted form of POSIX path of aFolderItem