Copy link to clipboard
Copied
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.
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
...
Copy link to clipboard
Copied
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); }
Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
You can use the Lasso tool, it has the Feather setting.
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
Find more inspiration, events, and resources on the new Adobe Community
Explore Now