Monday, December 3, 2007

How to use Photoshop Script?

Many people are not familiar with the power of Photoshop Scripts and aren't aware that there are many excellent sample scripts and learning guides included with Photoshop. This tutorial will show you where to find the Photoshop Scripting Guides, show you how to install Photoshop Scripts, and explain how to work with Photoshop Scripts.

So Why Use Scripts Instead Of Actions?

Photoshop Scripts are Actions on steroids, and Scripts can be super smart. From the official Adobe Scripting Guide come these examples of scripting power: You can add conditional logic, so that the script automatically makes "decisions" based on the current situation.
For example, you could write a script that decides which color border to add depending on the size of the selected area in an image: "If the selected area is smaller than 2 x 4 inches, add a green border; otherwise add a red border"

A single script can perform actions that involve multiple applications. For example, you could target both Photoshop CS2 and another Adobe Creative Suite 2 Application in the same script. You can open, save, and rename files using scripts.

Download the documents

For a complete understanding of the power and complexity of scripts read through the Scripting documentation that came with your Photoshop application installation or you can download it from www.adobe.com/devnet/photoshop/pdfs/JavaScriptReferenceGuide.pdf

How to install Photoshop Scripts

After downloading a script you must copy it into your Scripts folder.
On a PC, the path would be: C:\Program Files\Adobe\Photoshop (CS or CS2)\Presets\Scripts\ After copying a script to this folder you'll need to Quit and then Restart Photoshop before the script appears in the File> Scripts menu.

To Run A Photoshop Script

To run a script choose File> Scripts and select the script from the list, which will include any script file that was saved with a .js or .jsx extension and saved in the Presets/Scripts folder. If you want to run a script that was saved in a different location, simply choose File> Scripts> Browse and navigate to the specific script you want to use.

To Set Scripts To Run Automatically

You can have an event such as saving or exporting a file trigger a JavaScript in Photoshop. Here's how: Choose File> Scripts> Scripts Events Manager.

Select Enable Events To Run Scripts/Actions. From the Photoshop Event menu, choose the event that will trigger the script. Select Script and then choose the script to run when the event occurs. The event and its associated script will be listed in the dialog box.

To disable and remove individual events, select the event in the list and click Remove. To disable all events, but keep them in the list, deselect Enable Events To Run Scripts/Actions.

Source

No comments: