Awesome.
Any idea how to add this to the following script listener bit that changes the canvas size?
/ =======================================================
var idCnvS = charIDToTypeID( "CnvS" );
var desc105 = new ActionDescriptor();
var idWdth = charIDToTypeID( "Wdth" );
var idPxl = charIDToTypeID( "#Pxl" );
desc105.putUnitDouble( idWdth, idPxl, WIDTH GOES HERE? );
var idHght = charIDToTypeID( "Hght" );
var idPxl = charIDToTypeID( "#Pxl" );
desc105.putUnitDouble( idHght, idPxl, HEIGHT GOES HERE?);
var idHrzn = charIDToTypeID( "Hrzn" );
var idHrzL = charIDToTypeID( "HrzL" );
var idCntr = charIDToTypeID( "Cntr" );
desc105.putEnumerated( idHrzn, idHrzL, idCntr );
var idVrtc = charIDToTypeID( "Vrtc" );
var idVrtL = charIDToTypeID( "VrtL" );
var idCntr = charIDToTypeID( "Cntr" );
desc105.putEnumerated( idVrtc, idVrtL, idCntr );
executeAction( idCnvS, desc105, DialogModes.NO );
My initial thought was that I'd add the math bits above this, and then call the variables in the part where I put WIDTH GOES HERE, but that's not clear to me, since there's some if/then going on, and I'm not sure how to account for that. Perhaps the script listener isn't the way to go for this?