Reference Materials for Application Specific JavaScript

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

mac0ward

Reference Materials for Application Specific JavaScript

Post by mac0ward »

Hi,

I'm new-ish to JavaScript and scripting for Adobe software. I've been using all the documents that came with Photoshop and more I've found online (JavaScript Tools Guid, Photoshop CS4 JavaScript Reference, Photoshop CS4 Scripting Guide). It's not enough. Can you recommend more?

I'm a little bit frustrated with two things:

1) finding EVERYTHING I can access. For instance, I was writing a script for accessing the histogram's mean luminosity value. I was lucky that someone on the forum gave me the method to access this, because that method didn't appear anywhere in my reference materials.

2) once I find the properties / methods, seeing examples of them in script.

The forum pretty much solves the second problem. But for the first, I would love to know if you readers could point me to any good reference materials you've found.

Thank you,

Mac
Mike Hale

Reference Materials for Application Specific JavaScript

Post by Mike Hale »

Those are about all the docs there are on script Photoshop in javascript.

If something is not listed there is a good chance that there is no direct way to do whatever with javascript. That is one of the main reason for this forum. To find workarounds.

My advice is when you can find something you can't do, post a question and see if someone has found an answer.
mac0ward

Reference Materials for Application Specific JavaScript

Post by mac0ward »

well then, can I ask where all these charIDToTypeID / cTID / sTID s are coming from?

I keep seeing such language in scripts and have no idea what it's referencing.
SzopeN

Reference Materials for Application Specific JavaScript

Post by SzopeN »

Values are from the script listener log. Latest documentation (10 years old ) is in the Adobe SDK.
The functions itself are from the xbytor's Stdlib.
Mike Hale

Reference Materials for Application Specific JavaScript

Post by Mike Hale »

There is a plugin that ships with Photoshop called scriptlistner. If you install it a log will be created of most commands you do in the GUI. See the guide for info on installing scriptlistner.

That will cover most of what you see. For the rest you will need something like getterdemo in Xbytor's Xtools.
zottona

Reference Materials for Application Specific JavaScript

Post by zottona »

How do you access javascript elements in tokens? After I tokenize a phrase, I want to access every element of every token. I want to do this so that I can convert an english phrase into pig latin. So when you type Welcome to javascript in a form, the text area displays "elcomeway otay avascriptjay".
Paul MR

Reference Materials for Application Specific JavaScript

Post by Paul MR »

Something like this?

Code: Select allvar str="Welcome to javascript";
var str=str.split(' ');
alert("Token 1 = "+str[0] + ", Token 2 = "+ str[1] + ", Token 3 = "+ str[2]);