Skip to main content
tssee
Inspiring
February 11, 2016
Question

synthetic script

  • February 11, 2016
  • 2 replies
  • 289 views

I would like to know if there a list of scripts to retrieve the settings panel tools,

I made a move which I then converted into jsx this to be exact

cTID = function(s) { return app.charIDToTypeID(s); };

sTID = function(s) { return app.stringIDToTypeID(s); };

//

//==================== Action 9 ==============

//

function Action9() {

  // C

  function step1(enabled, withDialog) {

    if (enabled != undefined && !enabled)

      return;

    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);

    var desc1 = new ActionDescriptor();

    var ref1 = new ActionReference();

    ref1.putClass(cTID('AdjL'));

    desc1.putReference(cTID('null'), ref1);

    var desc2 = new ActionDescriptor();

    var desc3 = new ActionDescriptor();

    desc3.putBoolean(sTID("useLegacy"), false);

    desc2.putObject(cTID('Type'), cTID('BrgC'), desc3);

    desc1.putObject(cTID('Usng'), cTID('AdjL'), desc2);

    executeAction(sTID('make'), desc1, dialogMode);

  };

  // Imp

  function step2(enabled, withDialog) {

    if (enabled != undefined && !enabled)

      return;

    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);

    var desc1 = new ActionDescriptor();

    var ref1 = new ActionReference();

    ref1.putEnumerated(cTID('AdjL'), cTID('Ordn'), cTID('Trgt'));

    desc1.putReference(cTID('null'), ref1);

    var desc2 = new ActionDescriptor();

    desc2.putInteger(cTID('Brgh'), 14);

    desc2.putInteger(cTID('Cntr'), 0);

    desc2.putBoolean(sTID("useLegacy"), false);

    desc1.putObject(cTID('T   '), cTID('BrgC'), desc2);

    executeAction(sTID('set'), desc1, dialogMode);

  };

  step1();      // C

  step2(true, true);      // Imp

};

Action9.main = function () {

  Action9();

};

Action9.main();

// EOF

"action.jsx"

// EOF

The code seems to me too long

there something more compact.

This topic has been closed for replies.

2 replies

tssee
tsseeAuthor
Inspiring
February 12, 2016

Thanks chuck

Chuck Uebele
Community Expert
Community Expert
February 11, 2016

Action manager code, while it looks long, runs faster than shorter DOM code.