What the heck is a 'TypeID'?

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

Moderators: Tom, Kukurykus

bdeshazer

What the heck is a 'TypeID'?

Post by bdeshazer »

I've done a fair bit of DOM scripting, but am now starting to delve a bit more into using Action Manager code as needed for either functionality or performance. I've looked through scripting documentation and tried to peruse a bit of the PS SDK documentation in order to get a handle on what exactly TypeIDs are and what the need is for application-level functions like 'charIDToTypeID' and 'stringIDToTypeID' and their reverse functions, but I'm coming up blank on any kind of basic explanation. Can anyone enlighten me or point me to a clear and basic explanation somewhere?

I kind of get that charIDs are just four-character abbreviations for all the scriptable functions within PS, and that stringIDs are similar but longer than four characters, both acting almost as keys or selectors I guess... but what is the need to convert these to TypeID's, referenced as "runtime IDs" in the scripting documentation, which are apparently just long integers which can change from run-to-run of the PS application...(sounds kinda like memory address pointers...)

Sure, I could keep on just using these functions as outlined in many examples on this and other online forums and from ScriptListener code, but I'd like to have a better understanding of what is really happening...

Apologies for such a basic question, thanks for your time.

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

kostyanet

What the heck is a 'TypeID'?

Post by kostyanet »

en.wikipedia.org/wiki/Stack-oriented_programming_language

EDIT: Link disabled as it is not relative to Photoshop's typeID.
Mike Hale

What the heck is a 'TypeID'?

Post by Mike Hale »

A Photoshop typeID is a Number that is used by Action Manager.

There are two types of typeIDs. One type comes from charID( and their stringID equivalents ). Those typeIDs are 10 digits in length and do not change. CharIDs are always 4 chars, padding with spaces when needed. So charIDs could be replace with the correct typeID but very few people do so.

The other type comes from stringIDs that do not have a charID equivalent. Those typdIDs vary in length( I normally see 3 or 4 digits ) but do/can change between Photoshop sessions. StringIDs vary in length( can be 4 or less as well as more than 4 ).

I think CharID and StringID are used Action Manager in an appempt to make it more readable. Which is clear that it refers to a Document - 1147366766 or 'Dcmn'?
csuebele

What the heck is a 'TypeID'?

Post by csuebele »

Mike is correct about the ID types. From what I understand, Adobe attempted to make the code more readable, but they started out with charID and then ran out of numbers, so started using stringIDs. I ran across this issue when trying to use blend modes. Most of the older ones use charIds, but the newer ones use stringIds and they are not interchangeable. Tom Ruak straighten me out on that and showed some examples where if you switched, it caused problems. The trouble is that Adobe can't go and change everything to stringIds, which is more readable as it would mess up old scripts. So the stringIds and charIds need to be converted to typeIds for the program to handle them.
Mike Hale

What the heck is a 'TypeID'?

Post by Mike Hale »

I think it is more likely that Adobe run out of 4 char combinations that made sense as a mnemonic so switched to stringIDs which don't have the four char limit. There are over 450,000 possible charIDs with is far more than what is being used because most of those don't make sense. ie 'aaaa', 'ohuq', etc.