comments (6) Views: 12,437
The prime reason I wanted to look into scripting Photoshop was the work I do at Goba.mobi. One of my responsibilities is to output graphics for our iPhone and Android applications. Problem is that we utilize 3 different sizes: high res (2x pixel density at 640x960) for iPhone 4 and 4S, medium res (1.5x pixel density at 480x720) for modern Android devices, and (1x pixel density at 320x480) for low res Android devices, iPads, and older iPhones. This leads to lots of confusion and hassle when I send assets over to our developers. Even though I'm using Actions already there's still a lot of manual work neded to select folders, and type in file names. I decided I wanted to make it easier on myself. Enter ExtendScript.
ExtendScript allows users to write a script which contains conditional statements based on the number of layers, or the height and width of a document, or any of a large number of variables. Save your creation with a .jsx extension and you're good to go. In my case I wanted nice and simple. Take a base file name, save out a graphic in 3 different sizes, into 3 different folders. Here's what I came up with.
It's also worth noting that while ExtendScript Toolkit is a nice piece of software it's missing some key features. It doesn't have code complete which would make it awesome. It also doesn't have great error reporting. Several times while writing the above script I received a "General Photoshop Error. Your version of Photoshop might not have this feature". But what it turned out to be was that I wasn't setting the correct options on the ExportOptionsSaveForWeb object. The main reason you'd want to use this editor is that you can execute and debug scripts in Photoshop directly from the editor.
All in all I'm glad I started looking into this tool because it will help me be more effective. I do wish that Adobe would put a litle more effort into making their tooling and documentation top notch. It would definitely make a difference, and would greatly reduce frustration and could encourage more designers/developers to talk about this software.
If this article was interesting, or helpful, or even wrong, please consider leaving a comment, or buying something from my wishlist. It's appreciated!