Copy link to clipboard
Copied
I'm using this to preselect the count tool:
//////////////////////
selectTool('countTool');
//
function selectTool(tool) {
var desc9 = new ActionDescriptor();
var ref7 = new ActionReference();
ref7.putClass( app.stringIDToTypeID(tool) );
desc9.putReference( app.charIDToTypeID('null'), ref7 );
executeAction( app.charIDToTypeID('slct'), desc9, DialogModes.NO );
};
///////////////////////
After select it I don't want to use the default color, but another one and marker size point to 5 and I want to change it before start using it again by default.
Can be done by javascript code?
Copy link to clipboard
Copied
This the code the script listener spits out:
// =======================================================
var idslct = charIDToTypeID( "slct" );
var desc3 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref2 = new ActionReference();
var idcountTool = stringIDToTypeID( "countTool" );
ref2.putClass( idcountTool );
desc3.putReference( idnull, ref2 );
var iddontRecord = stringIDToTypeID( "dontRecord" );
desc3.putBoolean( iddontRecord, true );
var idforceNotify = stringIDToTypeID( "forceNotify" );
desc3.putBoolean( idforceNotify, true );
executeAction( idslct, desc3, DialogModes.NO );
// =======================================================
var idcountColor = stringIDToTypeID( "countColor" );
var desc4 = new ActionDescriptor();
var idRd = charIDToTypeID( "Rd " );
desc4.putInteger( idRd, 151 );
var idGrn = charIDToTypeID( "Grn " );
desc4.putInteger( idGrn, 153 );
var idBl = charIDToTypeID( "Bl " );
desc4.putInteger( idBl, 253 );
executeAction( idcountColor, desc4, DialogModes.NO );
// =======================================================
var idcountGroupMarkerSize = stringIDToTypeID( "countGroupMarkerSize" );
var desc6 = new ActionDescriptor();
var idSz = charIDToTypeID( "Sz " );
desc6.putInteger( idSz, 5 );
executeAction( idcountGroupMarkerSize, desc6, DialogModes.NO );