synthetic script
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.