Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Change Safari 's 'Safe Open' list Web Browsers
I found this article on ResExcellence on how to change the Safari "safe open" list (so Safari will auto-open files on download). Note: This requires use of a hex editor, so caution and current backups are required. This won't help with extensions that are longer than three characters, as you'll be replacing codes, and you cannot make them longer than they currently are.

[robg adds: I haven't tested this one, and I'm not sure it's worth the trouble -- if you control-click an item in the Downloads window, the first choice is Open. Seems a lot easier, and it should work regardless of the extension. Nonetheless, the referenced article does explain how to make Safari do this automatically, if you wish.]
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[20,125 views]  

Change Safari 's 'Safe Open' list | 9 comments | Create New Account
Click here to return to the 'Change Safari 's 'Safe Open' list' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Change Safari 's 'Safe Open' list
Authored by: jonbauman on Jan 26, '05 10:56:37AM

Why not just attach a folder action to your downloads folder, and write a script that only opens files of the appropriate type? For example:

property safe_extensions : {".doc", ".xls", ".torrent"}

on adding folder items to this_folder after receiving added_items
	tell application "Finder"
		repeat with afile in added_items
			repeat with extension in safe_extensions
				if the name of afile ends with extension then
					open afile
				end if
			end repeat
		end repeat
	end tell
end adding folder items to

---

jon

[ Reply to This | # ]

Change Safari 's 'Safe Open' list
Authored by: adrianm on Jan 26, '05 12:44:34PM

I just find it amusing you think .doc and .xls are 'safe' attachments.



[ Reply to This | # ]
Change Safari 's 'Safe Open' list
Authored by: jonbauman on Jan 27, '05 10:48:57AM

I guess it's all relative, considering that on Windows opening JPEGs might not be safe. However, I was under the impression that the macro virus problems had been handled, and I don't open Excel or Word documents from untrusted sources anyway.

---

jon

[ Reply to This | # ]

Change Safari 's 'Safe Open' list
Authored by: pascalpp on Jan 26, '05 05:16:01PM

Do you download to your Desktop folder?

I do, and I found that attaching a Folder Action to the desktop was very annoying, as any time i created a new folder and tried to rename it, the folder action would invoke and interrupt the naming process. Then i'd have to reselect the folder, hit return, right arrow, and finish naming. Very annoying.

Does this happen to you?



[ Reply to This | # ]
Change Safari 's 'Safe Open' list
Authored by: jonbauman on Jan 27, '05 11:04:20AM
Do you download to your Desktop folder?

No, I like to keep my desktop clean, so I have a separate downloads folder. If you prefer to have your downloads sitting on your desktop, set up a downloads folder, and have the script move new additions to the desktop and then open them. That way, it won't interfere with any modifications to files already on your desktop.

Try creating a new folder that you use only for downloads and attach this script to it:

property safe_extensions : {".doc", ".xls", ".torrent"}

on adding folder items to this_folder after receiving added_items
	tell application "Finder"
		repeat with afile in added_items
			move afile to desktop
			repeat with extension in safe_extensions
				if the name of afile ends with extension then
					open afile
				end if
			end repeat
		end repeat
	end tell
end adding folder items to

---

jon

[ Reply to This | # ]

Thanks! Change Safari 's 'Safe Open' list
Authored by: alexmathew on Jun 20, '08 11:41:16AM

I was just setting up a new Macbook Air for a colleague moving from Windows and this lack of "feature" about Safari was bugging him. Your Script will save my reputation - I had said that the Mac can do anything Windows does - for him anyway!
Thanks
AM

I would give 5 stars for THIS hint - there should be a way of rating replies too!



[ Reply to This | # ]
Change Safari 's 'Safe Open' list
Authored by: redsweater on Jan 26, '05 01:18:10PM

This hack works.

In response to robg's comment that it's not worth the trouble, I think it depends entirely on what the purpose for the auto-open is. If it's some file format you download every once in a while then sure it may not be, but if it's something that essentially expands your browsing experience, it's a big pain when things don't work streamlined. Imagine, for example, if you had to click and open every PDF you click on the web. If you don't use a PDF plugin, it's very convenient that Safari auto-opens the PDF after downloading it.

Apple should concede that there are other formats for which users might want this kind of integration, and provide the same configurability that every other browser has.

---
--
Daniel Jalkut
http://www.red-sweater.com/



[ Reply to This | # ]
Change Safari 's 'Safe Open' list
Authored by: macondo on Jan 27, '05 06:04:43PM

Still you are not saying anything new. If you assign Adobe Reader as default app for all PDF documents, Safari will download the PDF and inmediately open them. No Applescript involved.

Actually there is another thread saying the PDF plug in is a wonder of code, but I actually prefer the files opened by the Adobe Reader instead of the Plugin, which is slow as it has always been since version 5.

Best



[ Reply to This | # ]
Change Safari 's 'Safe Open' list
Authored by: Casemon on Dec 11, '08 10:14:55PM
Couldn't get the above applescript to work in Leopard (even tho other Actions worked).

Found this technique and it works even better;
http://www.manuelstuder.ch/2008/03/14/how-to-automatically-open-torrent-and-other-files-in-safari/

Even links back to macosxhints.com (different article).

[ Reply to This | # ]