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 OneLocate 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 TwoIn 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.
Step ThreeNow 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 FourTo 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 FiveFind 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.
|