• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Stuck trying to read the global light angles (Cannot identify key type)

Contributor ,
Feb 17, 2017 Feb 17, 2017

Copy link to clipboard

Copied

// Place the enumeration into the document descriptor

var document = sTID("document");

var ordinal = sTID("ordinal");

var target = sTID("targetEnum");

var ref = new ActionReference();

ref.putEnumerated(sTID("layer"), sTID("ordinal"), sTID("targetEnum"));

var desc = executeActionGet(ref);

var keyID = desc.getKey(11);

alert(typeIDToStringID(keyID));

I've tried all sorts of methods on this key and I don't know what to do with it. IE: How do you go into it deeper when you can't even find out what TYPE it is?

desc.getBpolean(keyID); // returns true

desc.getDouble(keyID); // returns 3

desc.getInteger(keyID); // returns 3

desc.getList(keyID); // returns an ActionList -object containing nothing

desc.getType(keyID); // returns INTEGERTYPE (because duh... the key is a number)

desc.getUnitDoubleType(keyID); // returns a new keyID for noneType

desc.getUnitDoubleValue(keyID); // returns 3

TL:DR:

Where is the global light - altitude angle, stored? How do I retrieve it?

TOPICS
Actions and scripting

Views

263

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Guide ,
Feb 17, 2017 Feb 17, 2017

Copy link to clipboard

Copied

LATEST

alert(globalAngle());

function globalAngle(){

var ref = new ActionReference();

ref.putProperty(charIDToTypeID('Prpr'),stringIDToTypeID("globalAngle"));

ref.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );

var desc = executeActionGet(ref).getObjectValue(stringIDToTypeID("globalAngle"));

return desc.getDouble(stringIDToTypeID("globalLightingAngle"));

};

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines