Copy link to clipboard
Copied
I am using scriptlistener to record some scripts. It is of course filled with this stuff
var id41 = charIDToTypeID( "Vrtc" );
var id42 = charIDToTypeID( "#Rlt" );
I can figure some of it out. But I some I can't. In this case I am not sure what" #Rlt" means or if there are perhaps any other options that migh be used there.
Is there a reference somewhere to all of these codes? Or is this just magic?
TIA
The nearest official documentation will proberbly be the Javascript Reference Appenddix A : Event ID Codes.
This document should be found C:\Program Files\Adobe\Adobe Photoshop CS4\Scripting\Documents
Copy link to clipboard
Copied
I think X and Mike are the experts in this field but sometimes you can get something meaningful using:
$.writeln(typeIDToStringID(charIDToTypeID( "#Rlt")));
In this case it returns "distanceUnit" but I call it relative to 72pixels as that is normally what it is.
Copy link to clipboard
Copied
Thanks for the response, that does help a bit, but I m still wondering if this stuff is written down anywhere? Maybe it isn't? ![]()
Copy link to clipboard
Copied
The nearest official documentation will proberbly be the Javascript Reference Appenddix A : Event ID Codes.
This document should be found C:\Program Files\Adobe\Adobe Photoshop CS4\Scripting\Documents
Copy link to clipboard
Copied
Hi Paul,
Thanks for your answer.
However, it seems that there is almost nothing for PremierePro.
Would you know any way to "shuttle" (left or right) via scripting as we can do it by pressing 'j' (or 'l') keys?
Cheers,
Copy link to clipboard
Copied
I don't think that there is any documentation that is helpful to script writers. There are some references but like Paul I find it faster to convert to string than look up in a reference.
Two notes to add to Paul's comments.
charIDs are 4 chars in length or padded with spaces until the length == 4.
#Rlt is unitDistance. The values are stored as 'units' where each 'unit' = 1in/72 no matter what the doc resolution. I perfer not to think of the value as pixels
#Pxl is pixelUnit. The values are stored as pixels.
Copy link to clipboard
Copied
There is the file xtools/xlib/PSConstants.js that has all of the known mappings. It is generated from the SDK header files, so it's as close to be complete as I can get it.
In xtools/xlib/stdlib.js, there is the id2char function will will take a type ID and convert it back to a human readable string using the PSConstants tables or the functions provided by PS.
If you want to clean up the ScriptListerner output, try xtools/apps/SLFix.jsx.
You can find xtools here:
http://sourceforge.net/scm/?type=cvs&group_id=173281
or here:
http://ps-scripts.cvs.sourceforge.net/viewvc/ps-scripts/xtools/
The current tarball on the site (v1.6) is horribly out of date. I need to build out a fresh one. Using cvs will keep you current.
-X
Copy link to clipboard
Copied
Thanks everyone who repsonded!
I will try to figure this out from here. I am certain that I will have a more detailed question when I get to actully writing the script.
I can feel the power in the JavaScript /Applescript stuff ( I don't use windows so I can't speek to vbscript). I just can't write anything useful yet. ![]()
Todd
Copy link to clipboard
Copied
If you really want to have a look at some Adobe documentation download the Photoshop SDK and look at PITerminology.h
Here is unit section.
#define unitAngle '#Ang' // Unit value - base degrees
#define unitDensity '#Rsl' // Unit value - base per inch
#define unitDistance '#Rlt' // Unit value - base 72ppi
#define unitNone '#Nne' // Unit value - coerced.
#define unitPercent '#Prc' // Tagged unit value.
#define unitPixels '#Pxl' // Tagged unit value.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now