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

How do I set the content-aware move tool mode to move

Engaged ,
May 08, 2019 May 08, 2019

hi,everybody,

     How do I set the content-aware move tool mode to move?

     QQ截图20190508151745.png

TOPICS
Actions and scripting
1.7K
Translate
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

correct answers 1 Correct answer

People's Champ , May 11, 2019 May 11, 2019

// select tool

var r = new ActionReference();

r.putClass(stringIDToTypeID("recomposeSelection"));

var d = new ActionDescriptor();

d.putReference(stringIDToTypeID("null"), r);

executeAction(stringIDToTypeID("select"), d, DialogModes.NO);

// set option

var r = new ActionReference();

r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("tool"));

r.putEnumerated(stringIDToTypeID("application"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));

var ret = executeActionGet(r);

var options = r

...
Translate
Adobe
Community Expert ,
May 08, 2019 May 08, 2019

Create a tool Preset for the content aware Move tool where mode is et to move.  Then in your script  Select the Conten aware Move tool to make it the current tool. Then select tool preset "content aware move tool mode move"

selectTool("recomposeSelection");                         // Content Arare Move Tool

selectToolPreset("Content-Aware Move Tool Mode Move");    // Mode move

// =================================================== Helper functions ===================================================== //

function selectTool(tool) {

    var desc9 = new ActionDescriptor();

        var ref7 = new ActionReference();

        ref7.putClass( app.stringIDToTypeID(tool) );

    desc9.putReference( app.charIDToTypeID('null'), ref7 );

    executeAction( app.charIDToTypeID('slct'), desc9, DialogModes.NO );

};

function selectToolPreset(PresetName) {

var desc = new ActionDescriptor();

var ref = new ActionReference();

ref.putName( stringIDToTypeID( "toolPreset" ), PresetName );

desc.putReference( charIDToTypeID( "null" ), ref );

executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );

}

JJMack
Translate
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
Engaged ,
May 09, 2019 May 09, 2019

thank you,That's one way to do it.i wanted to reset all tools  but the mode of the content-aware move tool  not reset,it may be a bug in photoshop. so i need other method.

Translate
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 ,
May 09, 2019 May 09, 2019

Please report the reset bug to Adobe on their feedback site Photoshop Family Customer Community

JJMack
Translate
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
People's Champ ,
May 11, 2019 May 11, 2019

// select tool

var r = new ActionReference();

r.putClass(stringIDToTypeID("recomposeSelection"));

var d = new ActionDescriptor();

d.putReference(stringIDToTypeID("null"), r);

executeAction(stringIDToTypeID("select"), d, DialogModes.NO);

// set option

var r = new ActionReference();

r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("tool"));

r.putEnumerated(stringIDToTypeID("application"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));

var ret = executeActionGet(r);

var options = ret.getObjectValue(stringIDToTypeID("currentToolOptions"));          

var tool = ret.getEnumerationType(stringIDToTypeID("tool"));

options.putInteger(stringIDToTypeID("recomposeMode"), 2); // or 1 for move

var r = new ActionReference();

r.putClass(tool);

var d = new ActionDescriptor();

d.putReference(stringIDToTypeID("null"), r);

d.putObject(stringIDToTypeID("to"), stringIDToTypeID("null"), options);

executeAction(stringIDToTypeID("set"), d, DialogModes.NO);

Translate
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 ,
May 11, 2019 May 11, 2019

That is a much better way then requiring a tool preset.  Still Reset tool should set the tools option mode to some default setting.

JJMack
Translate
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
Engaged ,
May 12, 2019 May 12, 2019
LATEST

It's perfect, thank you

Translate
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