• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Is there a command to script Content Aware scale (not actions, but actual script)?

Community Beginner ,
Nov 30, 2015 Nov 30, 2015

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

TOPICS
Actions and scripting

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Adobe Employee ,
Nov 30, 2015 Nov 30, 2015

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 30, 2015 Nov 30, 2015

Copy link to clipboard

Copied

Have you tried using ScriptListener to produce Action Manager code?

Moving post to Scripting forum.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 30, 2015 Nov 30, 2015

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines