Copy link to clipboard
Copied
I work with CMYK images and I want to create script which will flatten layers and complete trapping 0,2mm. I tried with Script Listener and i got this code but result is slightly different when i do it manuly.
var idFltI = charIDToTypeID( "FltI" );
executeAction( idFltI, undefined, DialogModes.NO );
// =======================================================
var idTrap = charIDToTypeID( "Trap" );
var desc6698 = new ActionDescriptor();
var idWdth = charIDToTypeID( "Wdth" );
var idRlt = charIDToTypeID( "#Rlt" );
desc6698.putUnitDouble( idWdth, idRlt, 0.566895 );
executeAction( idTrap, desc6698, DialogModes.NO );
I would work in px and trap to the desired unit in px values.
// Save the current ruler units and set to pixels
var savedRuler = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
// Do your stuff...
// Restore the ruler units
app.preferences.rulerUnits = savedRuler;
Copy link to clipboard
Copied
Right. Would it be possible to get the current unit setting via something like .executeActionGet()? I’m not that familiar with ActionDescriptor syntax.
Copy link to clipboard
Copied
No. You can only control user inputs by script. Anyway I repoted the bug.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more