Hi,
For the first time, I’m trying to create folder actions on OSX (I’m on OSX10.2.8 ). I’ve went through the Folder Actions FAQ’s here on MacScripter to get the gist of what I need to do, but I’m having a very confusing time trying to get some simple scripts to work.
I started with a simple script (theScript) like this …
on adding folder items to this_folder after receiving added_items
tell application "Finder" to display dialog "OK!"
end adding folder items to
…and tried attaching it to a folder (theFolder) through System Events…
tell application "System Events" to attach action to theFolder using theScript
…and then verifying that it was actually attached…
tell application "System Events"
name of every script of folder action theFolder
end tell
…but adding something to the folder doesn’t trigger the script.
Here’s the weird part. If I attach one of the sample scripts that came with the system, like “add - new item alert.scpt,” it works fine, but, if I copy the code from the sample script, paste it into a new script, and save as something new, it doesn’t work. I tried saving as a compiled script, and application. Also, I tried duplicating the sample script in the finder (creating “add - new item alert copy.scpt”), and attaching the duplicate. That doesn’t work. The only scripts I get to work are the samples, if used as-is.
I’m on OSX 10.2.8, with AppleScript v1.9.1, and did enable folder actions prior to attempting this. Sorry for all my italics. :oops:
Thanks,