charIDToTypeID Photoshop Javascript

血红的双手。 提交于 2019-12-04 11:41:13

This code was not "written", per se, but was automatically generated by the Script Listener plugin.

Not all of the properties and methods of the Photoshop API are available in the object model, however they are usually still accessible. To use these undocumented features you can install the script listener plugin and perform the actions in Photoshop. The script listener will generate code reflecting the actions you've performed.

For example, there are no explicit methods or properties for the Brush object, but using the script listener, you can open Photoshop, manually adjust the brush size property, and the script listener will automatically generate working, albeit cryptic, code. Any action you perform will be recorded by the script listener so take care not to perform too many actions or you will have a hard time narrowing down the results to those specific methods.

Anyway, I tend to use it as a last resort, but anytime you're dealing with undocumented methods in the Photoshop API, the script listener becomes a necessary evil. Don't assume a method or property isn't available just because it isn't documented. Hope that helps.

smoore4

This is the site that I usually reference for charIDToTypeID:

http://web.archive.org/web/20140121053819/http://www.pcpix.com/Photoshop/char.htm

(Note linked content is from 2013)

Using this, you can find the string representations from the ScriptListener plug-in. In your case, this is what they mean...

phClassLayer -> 1283027488 -> "Lyr "  layer
phTypeOrdinal -> 1332896878 -> "Ordn"  ordinal
phEnumTarget -> 1416783732 -> "Trgt"  targetEnum
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!