Folder Actions

linkmaster03

Registered
I have this folder called AT Math. I made and saved an Applescript to my desktop. I want to use folder actions to make the script execute when I open my AT Math folder. Can you use folder actions for this? If not how do you do it?

I need help!
 
Yes, you can do this with Folder Actions. However, a poorly-documented limitation of Folder Actions is that you can ONLY use scripts from your "Library/Scripts/Folder Action Scripts" folder. If you try to attach a script on your desktop, it will simply not do anything. I guess this is supposed to be a security thing. So be sure to put your scripts in that folder.

As for the script itself, it should look something like this:
Code:
on opening folder this_folder
	--do stuff here
end opening folder
Hope this helps.
 
But... would I have to put that stuff about opening folder in my script? Cause the script would be attached to the folder anyways so wouldn't it know to execute it when the folder opens? If not, can you show me what my script should look like so it would execute when the folder AT Math on my desktop opens? My regular script is:

Code:
say "Welcome to your A Tee math folder" using "Zarvox"
 
Oh. Why wouldn't the script be attached to the folder? If you're not attaching the script, then Folder Actions isn't what you want.

I suppose you could have a script applet running in the background repeatedly checking if the folder is open using its idle handler. But that would be awfully messy.

IF you use Folder Actions, the script is simple:
Code:
on opening folder this_folder
	say "Welcome to your A Tee math folder" using "Zarvox"
end opening folder
Just save that to the Folder Actions Scripts folder, attach it to your AT Math folder, and you're done.
 
Back
Top