Skip to main content
Geppetto Luis
Legend
October 29, 2019
解決済み

healing brush tool select samples

  • October 29, 2019
  • 返信数 1.
  • 1215 ビュー

I can't find the script that allows me to select the desired sample

the discussion on this was present in the old forum
unfortunately it has been canceled

someone could post the script in question.

 

このトピックへの返信は締め切られました。
解決に役立った回答 r-bin
try
    {
    // select tool
    var d = new ActionDescriptor();
    var r = new ActionReference();
    r.putClass(stringIDToTypeID("magicStampTool"));
    d.putReference(stringIDToTypeID("null"), r);
    executeAction(stringIDToTypeID("select"), d, DialogModes.NO);


    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"));

    // Current layer
    options.putBoolean(charIDToTypeID("StmS"), false);
    options.putBoolean(charIDToTypeID("StmB"), false);

    // Current & below
    //options.putBoolean(charIDToTypeID("StmS"), true);
    //options.putBoolean(charIDToTypeID("StmB"), true);


    // All layers
    //options.putBoolean(charIDToTypeID("StmS"), true);
    //options.putBoolean(charIDToTypeID("StmB"), false);

    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);
    }
catch (e) { alert(e)  }

返信数 1

r-bin解決!
Legend
October 31, 2019
try
    {
    // select tool
    var d = new ActionDescriptor();
    var r = new ActionReference();
    r.putClass(stringIDToTypeID("magicStampTool"));
    d.putReference(stringIDToTypeID("null"), r);
    executeAction(stringIDToTypeID("select"), d, DialogModes.NO);


    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"));

    // Current layer
    options.putBoolean(charIDToTypeID("StmS"), false);
    options.putBoolean(charIDToTypeID("StmB"), false);

    // Current & below
    //options.putBoolean(charIDToTypeID("StmS"), true);
    //options.putBoolean(charIDToTypeID("StmB"), true);


    // All layers
    //options.putBoolean(charIDToTypeID("StmS"), true);
    //options.putBoolean(charIDToTypeID("StmB"), false);

    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);
    }
catch (e) { alert(e)  }
Geppetto Luis
Geppetto Luis作成者
Legend
November 1, 2019

Mr. r-bin
Thanks for your super help