Anyone can run a script, because it's easy as choosing a menu command. You can try it right now, because Photoshop comes with some sample scripts.
To run a script from within Photoshop:
Open a test document (something expendable).
Choose File > Scripts.
Do one of the following:
Choose a script from the Scripts submenu, if any are listed.
Choose Browse to look for a script. The sample scripts that come with Photoshop are located inside the Adobe Photoshop CS2 application folder, in
You can also trigger a script when a specific event happens in Photoshop. For example, you can use a script to control what happens when someone chooses File > Save. You set this up in the Script Events Manager.
To associate a script with an event:
Choose File > Scripts > Script Events Manager.
Make sure Enable Events to Run Scripts/Actions is enabled.
Choose an event from the Photoshop Event pop-up menu. For the Save example I mentioned, choose Save Document.
Choose a script from the Script pop-up menu. For the example, choose Save Extra JPEG.jsx.
Click Add. The event you set up is added to the list at the top of the Script Events Manager dialog box (Figure 19.1).
Figure 19.1. Use the Script Events Manager to run any script when a specific event happens in Photoshop.
To test the Save example, open a test file, choose File > Save, and save the PSD file in a convenient location. Look in the folder where you store the original test documenta copy of the file with a .jpg filename extension should now exist next to it. (The sample script applies the last-used JPEG settings, as if you had chosen the JPEG file format and simply clicked Save.)
I use the Script Events Manager again later in another, more specific example.
To edit the list of Photoshop Events in the Script Events Manager, edit the file Script Events Manager.xml, located inside the Adobe Photoshop CS2 Settings folder.