So - I’m trying to work around the Safari “won’t auto-open unsafe documents” limitation. Somebody gave me the bright suggestion of writing a folder action script that attaches to the downloads folder and auto-opens the file if it’s one of the desired types.
This works “OK” … emphasis on the “OK”! First I had to work around a problem with System Events consistently crashing because my app deletes the file after it’s done processing it.
OK, but what’s worse is that the Folder Action scripts seem to “take back control” from any application that is activated by the folder script. For example:
on adding folder items to this_folder after receiving these_items
set theFile to item 1 of these_items
tell application "QuickTime Player"
activate
open theFile
end tell
end adding folder items to
Will NOT leave the user in QuickTime Player when a file is dragged (or downloaded into) the downloads folder. It seems that the process of “wrapping up” the folder action takes control back away from the app that was activated.
Does anybody have a smoother experience with Folder Actions? I admit I’m running on 10.2 for this particular situation, so it might be better on 10.3.
Any advice appreciated!