Letting Photoshop Write Scripts for You (Installing Script Listener)


One evening while watching some very useless television show, I was looking through some of the scripting guide files that come with Photoshop CS2 (yep, that's what I do at night). I stumbled across one of the best-kept secrets of writing scripts for PhotoshopScript Listener. You see, any tool that makes Photoshop do more of the work for me gets my vote, and that is exactly what the Script Listener does.

Step One

Locate the ScriptListener plug-in file. On a Mac, go to Hard Drive:Applications:Adobe Photoshop CS2:Scripting Guide:Utilities, and select the ScriptingListener.plugin file. On a PC, go to C:\Program Files\Adobe\Adobe Photoshop CS2\Scripting Guide\Utilities, and select the ScriptListener.8li file. Then choose Edit>Copy.

Step Two

In the Adobe Photoshop CS2 folder, navigate to the Plug-Ins folder and in the Adobe Photoshop Only folder, select Automate. Choose Edit>Paste to paste the copy of the ScriptingListener.plugin or ScriptListener.8li file into the Automate folder.

Turbo Boost

When writing scripts, make sure to comment your script so others (and yourself) can look at it later and decipher what is happening. To create a comment just type two forward slashes (//) first.


Step Three

Now you need to open Photoshop CS2. If it's already open and you never closed it, go ahead and close it and then start it up again. The Script Listener will now create a log file of everything that you do in Photoshop. This file contains the JavaScript code that represents all of your commands and actions in Photoshop. (In Windows, a VBScript log file will also be created.) In Mac OS, Script Listener creates the file on your Desktop. In Windows, Script Listener places the files on your C:\ drive.

Step Four

To verify this is working, press Command-N (PC: Control-N) to create a new document. Enter 800 pixels for the width and 600 pixels for the height. Select the Type tool (T) and create some text that reads "Hello World." Don't worry about what font size or style you use at this point.

Step Five

Find the JavaScript log file and open it using a text editor. I have to warn you, thoughthis is not for those with weak hearts or those who frighten easily. This log file is really scary looking, but you should be able to see some familiar text in it (highlighted in the screen capture here). Look for the size of the new document that you created in Step Four. Also, you can see the text that you created, as well. Without getting too technical, these are the commands getting sent to Photoshop in the background; everything you do can be represented in this type of language.

Turbo Boost

Adobe Bridge can run scripts, too. Be sure that if you install a third-party script you know whether it's intended for Photoshop or Bridge.




Photoshop CS2 Speed Clinic
The Photoshop CS2 Speed Clinic: Automating Photoshop to Get Twice the Work Done in Half the Time
ISBN: 0321441656
EAN: 2147483647
Year: 2006
Pages: 113

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net