Copy link to clipboard
Copied
Copy link to clipboard
Copied
#target photoshop
var startRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
var res = activeDocument.resolution;
var cropFactor = res/8;
var Width = activeDocument.width.value - cropFactor;
var Height = activeDocument.height.value - cropFactor;
app.activeDocument.resizeCanvas(Width, Height, AnchorPosition.MIDDLECENTER);
app.preferences.rulerUnits = startRulerUnits;
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
#target photoshop
var startRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
var res = activeDocument.resolution;
var cropFactor = res/8;
var Width = activeDocument.width.value - cropFactor;
var Height = activeDocument.height.value - cropFactor;
resize(Width,Height);
app.preferences.rulerUnits = startRulerUnits;
function resize(Width,Height) {
var ad = new ActionDescriptor();
ad.putUnitDouble( app.charIDToTypeID('Wdth'), app.charIDToTypeID('#Pxl'), Width );
ad.putUnitDouble( app.charIDToTypeID('Hght'), app.charIDToTypeID('#Pxl'), Height );
ad.putEnumerated( app.charIDToTypeID('Intr'), app.charIDToTypeID('Intp'), app.stringIDToTypeID('bicubicSharper') );
executeAction( app.charIDToTypeID('ImgS'), ad, DialogModes.NO );
};
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied