Script for switching brush spacing on/off
Hi! I found a script that switches the brush spacing in this post https://community.adobe.com/t5/photoshop-ecosystem-discussions/q-brush-s-spacing-setting-for-get-set-or-ignore/m-p/9468530 .
But when it switches, it resets the brush to the default settings. Is it possible to switch without resetting the brush? Here is this script by r-bin
function get_brush_space_checkbox()
{
try
{
var r = new ActionReference();
r.putProperty( charIDToTypeID( "Prpr" ), stringIDToTypeID( "tool" ) );
r.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var ret = executeActionGet(r);
ret = ret.getObjectValue(stringIDToTypeID("currentToolOptions"));
ret = ret.getObjectValue(stringIDToTypeID("brush"));
ret = ret.getBoolean(stringIDToTypeID("interfaceIconFrameDimmed"));
return ret;
}
catch (e) { alert(e); }
}
///////////////////////////////////////////////////////////////////////////////////////////////////
function set_brush_space_checkbox(val)
{
try {
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID( "Brsh" ), charIDToTypeID( "Ordn"), charIDToTypeID( "Trgt" ) );
desc.putReference( charIDToTypeID( "null" ), ref );
var desc1 = new ActionDescriptor();
desc1.putBoolean( stringIDToTypeID("interfaceIconFrameDimmed"), val);
desc.putObject( charIDToTypeID( "T " ), charIDToTypeID( "Brsh" ), desc1 );
executeAction( charIDToTypeID( "setd" ), desc, DialogModes.NO );
ref = null;
desc = null;
desc1 = null;
}
catch (e) { alert(e); throw(e); }
}
