Photoshop JavaScript Scripting Part #1 – Intro and Image Processor

Posted on Saturday, 19 February 2011

Do you need a web video? For work examples of our unique, fun and original animated explainer videos, ‘how does it work’ videos, infographics videos, corporate videos and motion graphics go here.

Hello there! In today’s tutorial we will be looking at our series of getting started with Photoshop CS5 Scripting for beginners:

Since Photoshop CS (3,4 and 5) all support both JavaScript, AppleScript and VBScript, this series of quick guides to get started will focus on JavaScript only, for CS5. The scripting for earlier versions are very similar, so pretty much everything in here should also work for earlier CS versions (see manuals).

First of all, you will find the Photoshop CS5 JavaScript Reference here:

This reference is the official reference. This is important because among other things it contains the JavaScript Object Reference, where we will find all the properties and methods etc. that we will need later. These series of getting started guides will not cover everything but is intended to get you started. The scripting reference covers everything in detail.

We will also need the Adobe Photoshop CS5 Scripting Guide document:

This document covers Photoshop Scripting Basics, a Scripting Overview and much more. We recommend you read through the introduction, but this guide is more a crash-course in how to get started, without having to read the manuals.

First of all, we are going to have a look at what scripting support there is in PS CS5, starting with looking at the most important options available in the Scripts menu inside PS CS5.

Start by selecting File->Scripts

The options in the Scipts menu that we will look at in this series are:

  • Image Processor…
  • Script Events Manager…
  • Browse…

For the other options they are perhaps not as relevant here so for them please refer to the PS Help.

Let’s look at these in order, starting with Image Processor…

File->Scripts->Image Processor…

This is a pretty simple tool that allows you to process a folder of images, or to use the Open Images. It’s really easy to use. Here is the interface of Image Processor:

Let’s say you need to convert a folder with JPEG images to .PSD files.

(1) Simply select the Selected Folder… button, browse to where your images are, if you also want all of your subfolders processed in that folder, tick that box also.

Next, simply make sure you select (2) the location where you want the processed images to be saved. The options are:

  • Save in Same location
  • Select Folder…

It is often a good and safe idea to save the processed images into a different folder. Click Select Folder… and browse to where you want to save them. You can Make New Folder while you are browsing for where to put them.

(3) Make sure you select what file type you want to save as. Here we wanted to convert all images in the images to process folder to .PSD, thus tick the Save as PSD option and deselect the Save as JPEG option and Save as TIFF option if these are selected. (Save as JPEG is probably selected by default).

If you like, you can also save as TIFF and JPEG in the same process, which is nice. There is no option to save as any other formats by default. We can find out if this can be done later in this series using this Image Processor.

(4) Another last option, is to set up Preferences, if you want to run a certain Action on the images and not just convert them, you tick the Run Action box and then you can select any of the options available:

  • Vignette
  • Frame Channel
  • …. and so on…

What is really nice here is that any Actions that you have created, will be available in this drop-down-list. If you check out one of the other posts on this website, about Graphic Novel processing of an image, we had created such an Action, in two versions and named them ‘Cartoon’ and ‘Cartoon2’, these would thus be available here to select, allowing us to process and apply this Action automatically to any number of images in the folder. Instead of having to open each image and run an Action, you will save a huge amount of time, while the computer will do all the work for you. If you have hundreds or thousands of images to process, you could let the computer process there over night and they would be ready for you hopefully the next morning without you doing anything :D

(Note: You can also do an image resize and some other options that we didn’t mention. These are simple options you can select, let’s say you wanted to resize your images to 640×480 pixels, just type in 640 in the W: box and 480 in the H: box.)

This covers the Image Processor.

In Part 2, we will continue by looking at The Script Events Manager. See you then!

Video has skyrocketed in popularity over the last few years and are increasingly becoming the way people prefer to learn & be informed. Has your company got one yet? Get you Free Quote for your video here.

Ready To Partner?

Back To Top

How useful was this post?

Click on a star to rate it!

Average rating 3 / 5. Vote count: 2

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Don`t copy text!