Copy link to clipboard
Copied
Hi guys,
I'm not a programmer but I think this is the best section to ask this.
I'm wondering if it's possible to create a small JS script to toggle on/off the new Smoothing option in Photoshop CC 2018.
Thanks for reading!
R.
// try this
toggle_smoothing();
////////////////////////////////////////////////////////////////////////////////////////////
function toggle_smoothing()
{
try
{
var r = new ActionReference();
r.putProperty( charIDToTypeID( "Prpr" ), stringIDToTypeID( "tool" ) );
r.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var ret = executeActionGet(r);
var desc = ret.getObjectValue(stringIDToTypeID("currentToolOptions"));
...Copy link to clipboard
Copied
// try this
toggle_smoothing();
////////////////////////////////////////////////////////////////////////////////////////////
function toggle_smoothing()
{
try
{
var r = new ActionReference();
r.putProperty( charIDToTypeID( "Prpr" ), stringIDToTypeID( "tool" ) );
r.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var ret = executeActionGet(r);
var desc = ret.getObjectValue(stringIDToTypeID("currentToolOptions"));
if (desc.hasKey(stringIDToTypeID("smoothing")))
{
var smooth = desc.getBoolean(stringIDToTypeID("smoothing"));
var tool = ret.getEnumerationType(stringIDToTypeID("tool"));
desc.putBoolean(stringIDToTypeID("smoothing"), !smooth);
var r = new ActionReference();
r.putClass( tool );
var desc2 = new ActionDescriptor();
desc2.putReference( stringIDToTypeID( "null" ), r );
desc2.putObject( stringIDToTypeID( "to" ), stringIDToTypeID( "null" ), desc );
executeAction( stringIDToTypeID( "set" ), desc2, DialogModes.NO );
}
else
{
alert("Tool with no smoothing!");
}
}
catch (e) { alert(e) }
}
Copy link to clipboard
Copied
It works! Thank you very much r-bin!
I really appreciate the time you took to write the script.
You saved my life! ❤️