Here is the function you need ) // set only hardnesss 55 set_brush(undefined, 55) /////////////////////////////////////////////////////////////////////////////////////////////////// function set_brush(d, h, s) { 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")); var desc1 = ret.getObjectValue(stringIDToTypeID("brush")); var desc = new ActionDescriptor(); var ref = new ActionReference(); ref.putEnumerated( charIDToTypeID( "Brsh" ), charIDToTypeID( "Ordn"), charIDToTypeID( "Trgt" ) ); desc.putReference( charIDToTypeID( "null" ), ref ); if (d != undefined) desc1.putUnitDouble( charIDToTypeID( "Dmtr" ), charIDToTypeID( "#Pxl" ), d ); if (h != undefined) desc1.putUnitDouble( charIDToTypeID( "Hrdn" ), charIDToTypeID( "#Prc" ), h ); if (s != undefined) desc1.putUnitDouble( charIDToTypeID( "Spcn" ), charIDToTypeID( "#Prc" ), s ); desc.putObject( charIDToTypeID( "T " ), charIDToTypeID( "Brsh" ), desc1 ); executeAction( charIDToTypeID( "setd" ), desc, DialogModes.NO ); } catch (e) { alert(e); throw(e); } }
... View more