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

Feathering patch tool selection automatically

Engaged ,
Jul 16, 2022 Jul 16, 2022

When the patch tool is active and a selection is created with the patch tool, 

can a script listen for the patch selection and add a feather to the selection automatically?

 

The idea is to feather the patch tool selection automatically every time a patch tool selection is created.

TOPICS
Actions and scripting
503
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 , Jul 17, 2022 Jul 17, 2022

Simplified version

 

try {
    var feather = 2;

    if (!arguments.length) 
        {
        app.notifiers.removeAll();
        app.notifiers.add("set", new File($.fileName));
        app.notifiersEnabled = true;
        }
    else if (arguments[1] == stringIDToTypeID("set"))
        {
        var r = new ActionReference();
        r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("tool"));
        r.putEnumerated(stringIDToTypeID("application"), stringIDToTypeID("ordinal"), stringI
...
Translate
Adobe
People's Champ ,
Jul 17, 2022 Jul 17, 2022

Simplified version

 

try {
    var feather = 2;

    if (!arguments.length) 
        {
        app.notifiers.removeAll();
        app.notifiers.add("set", new File($.fileName));
        app.notifiersEnabled = true;
        }
    else if (arguments[1] == stringIDToTypeID("set"))
        {
        var r = new ActionReference();
        r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("tool"));
        r.putEnumerated(stringIDToTypeID("application"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));

        var tool = executeActionGet(r).getEnumerationType(stringIDToTypeID("tool"));           

        if (tool == stringIDToTypeID("patchSelection"))
            {
            var d = arguments[0];
        
            if (d.hasKey(stringIDToTypeID("null")))
                {
                if (d.getType(stringIDToTypeID("null")) == DescValueType.REFERENCETYPE)
                    {
                    var r = d.getReference(stringIDToTypeID("null"));
        
                    if (r.getForm() == ReferenceFormType.PROPERTY)
                        {
                        if (r.getProperty() == stringIDToTypeID("selection"))
                            {
                            var d = new ActionDescriptor();
                            d.putUnitDouble(stringIDToTypeID("radius"), stringIDToTypeID("pixelsUnit"), feather);
                            //try { executeAction(stringIDToTypeID("feather"), d, DialogModes.NO); } catch(e) { }
                            try { executeAction(stringIDToTypeID("feather"), d, DialogModes.ALL); } catch(e) { }
                            }
                        }
        
                    }                
        
                }
        
            }
        }
    }
catch (e) { alert(e.line+" " +e); }

 

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 ,
Jul 17, 2022 Jul 17, 2022

Great and thank you r-bin, that is exactly what I have in mind.

To automatically apply a feather to the selection made with the patch tool.

I did a quick test and works well with the dialog on or off.

Many thanks again for your help!

 

 

 

 

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
Enthusiast ,
Apr 10, 2023 Apr 10, 2023
LATEST

You can use the Lasso tool, it has the Feather setting.

IvanZayats_0-1681121884598.png

 

Though I got used to the Patch tool, so I posted a feature request. Vote for it 🙂

https://community.adobe.com/t5/photoshop-ecosystem-ideas/feather-for-the-patch-tool/idi-p/14414056

 

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