最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

charIDToTypeID Photoshop Javascript - Stack Overflow

programmeradmin9浏览0评论

Okay, I understand that charIDToTypeID converts a string into the ID photoshop can actually use but I'm seeing ones I cannot find reference for:

 var idLyr = charIDToTypeID( "Lyr " );
 var idOrdn = charIDToTypeID( "Ordn" );
 var idTrgt = charIDToTypeID( "Trgt" );

What is "Lyr ", "Ordn" and "Trgt" - I googled to find reference but they don't show up in the adobe reference info: .0/docs/WebHelp/app_notes/photoshop.htm

I'm trying to find out how this person wrote there code and I'm wondering how they choose to use those IDs when there is no reference to them online.

Okay, I understand that charIDToTypeID converts a string into the ID photoshop can actually use but I'm seeing ones I cannot find reference for:

 var idLyr = charIDToTypeID( "Lyr " );
 var idOrdn = charIDToTypeID( "Ordn" );
 var idTrgt = charIDToTypeID( "Trgt" );

What is "Lyr ", "Ordn" and "Trgt" - I googled to find reference but they don't show up in the adobe reference info: http://cssdk.host.adobe./sdk/1.0/docs/WebHelp/app_notes/photoshop.htm

I'm trying to find out how this person wrote there code and I'm wondering how they choose to use those IDs when there is no reference to them online.

Share Improve this question edited Jul 18, 2014 at 14:15 Mogsdad 45.7k21 gold badges162 silver badges285 bronze badges asked Dec 15, 2012 at 16:11 Stan LindseyStan Lindsey 4851 gold badge5 silver badges12 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 14

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 bees a necessary evil. Don't assume a method or property isn't available just because it isn't documented. Hope that helps.

This is the site that I usually reference for charIDToTypeID:

http://web.archive/web/20140121053819/http://www.pcpix./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
发布评论

评论列表(0)

  1. 暂无评论