PDA

View Full Version : Help! Basic folder action script.


scurge187
12-23-2006, 10:42 AM
Hi Mac guys,

I've been trying to understand the functions of folder actions. All I want is to have Safari place all download files into an action folder and the action folder will automatically open the document by default applications.

I've been struggling with this.. don't laugh. Thanks. :D

-Sergio
scurge187

cwtnospam
12-23-2006, 12:07 PM
You want to attach an Applescript like the one below to a folder. You can do this by right- or control-clicking the folder and selecting "Attach a Folder Action..." and then selecting the script. These scripts are normally stored in /Library/Scripts/Folder Action Scripts

on adding folder items to this_folder after receiving added_items
tell application "Finder"
repeat with aItem in added_items
open aItem
end repeat
end tell
end adding folder items to

hayne
12-23-2006, 12:41 PM
All I want is to have Safari place all download files into an action folder and the action folder will automatically open the document by default applications.

Note that it would be very insecure to have a setup like you describe where Safari would automatically open any file that was downloaded.

A malicious web site could have a link that would download a file that could do something bad - and it is even possible for a site to be set up to download a file just by you visiting the site without clicking on anything.

What you propose is far worse than using Safari's preference setting to automatically open "safe files". And it is strongly recommended to not have that preference setting checked (I wish Apple would remove it entirely).

NovaScotian
12-23-2006, 01:33 PM
To suggest just one possibility, suppose the download was a really evil AppleScript.