Script Editor Icon

Inserting folder actions handlers into your script

You can set up a script to run whenever a change is made to a folder, for example, when a new file is added to the folder. You attach a script containing folder action handlers to a folder. The script then watches for changes to the folder. When the specified change happens to the folder, your folder actions are executed. You can insert folder actions handlers into your script using the shortcut menu (also know as a contextual menu.)

To insert a folder actions handler into your script:

Step 1

Select the lines to be enclosed in the error handler. You can also choose to insert an empty handler into the script text by placing the insertion point on a blank line.

Step 2

Control-click in the selected area.

Step 3

Choose Folder Actions Handlers, and then choose the error handler option you want. The selected text will be enclosed within the chosen Folder Actions handler.

Adding To Folder: Runs when items are added to an attached folder.

Closing Folder Window: Runs when the attached folder window is closed.

Moving Folder Window: Runs when the attached folder window is moved.

Opening Folder: Runs when the attached folder is opened.

Removing Folder Items: Runs when items are removed from an attached folder.

Related Topics

shortcut menus