Copy link to clipboard
Copied
HI all,
I am looking for a way to introduce content aware scale in a script. I am not looking for an Action, but a coded script. is there a command to trigger content aware SCALE inside a script ? Thank you very much.
M
Copy link to clipboard
Copied
Hi mbrch,
Please check the below links related to the same.
The Content-Aware Scale command Photoshop CC
Photoshop Help | Content-aware scaling
Let us know if that helps.
Regards,
~Mohit
Copy link to clipboard
Copied
Have you tried using ScriptListener to produce Action Manager code?
Moving post to Scripting forum.
Copy link to clipboard
Copied
contentAware(200, 100);
function contentAware(_newWidth, _newHeight) {
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putEnumerated(charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt'));
desc1.putReference(charIDToTypeID('null'), ref1);
desc1.putEnumerated(charIDToTypeID('FTcs'), charIDToTypeID('QCSt'), stringIDToTypeID("QCSCorner0")); // from top-left corner
desc1.putUnitDouble(charIDToTypeID('Wdth'), charIDToTypeID('#Prc'), _newWidth); // new width in percent
desc1.putUnitDouble(charIDToTypeID('Hght'), charIDToTypeID('#Prc'), _newHeight); // new height in percent
desc1.putEnumerated(charIDToTypeID('Intr'), charIDToTypeID('Intp'), charIDToTypeID('Bcbc'));
desc1.putBoolean(stringIDToTypeID("contentAware"), true);
desc1.putDouble(charIDToTypeID('Amnt'), 100);
executeAction(charIDToTypeID('Trnf'), desc1, DialogModes.NO);
}
---
Anton Lyubushkin [@nvkzNemo] • www.uberplugins.cc