Smudge tool options

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

ra5040@eircom.net
Posts: 2
Joined: Sun Jan 08, 2017 6:29 pm

Smudge tool options

Post by ra5040@eircom.net »

I've used a script by Tom Ruark to change brush options and would like to be able to do the same with the smudge tool options. I've been partially successful with this script:

function setSmudgeOptions(tool,mode,strength,pfs){
// tool
var idset = stringIDToTypeID( "set" );
var desc226 = new ActionDescriptor();
var idnull = stringIDToTypeID( "null" );
var ref170 = new ActionReference();
var idSmTl = stringIDToTypeID(tool);
ref170.putClass( idSmTl );
desc226.putReference( idnull, ref170 );
var id12 = stringIDToTypeID( "to" );
var desc5 = new ActionDescriptor();
// strength
var id13 = stringIDToTypeID( "strength" ); // Set Smudge tool Strength
var id14 = stringIDToTypeID( "percentUnit" );
desc5.putUnitDouble( id13, id14, strength);
// blend mode
var id15 = stringIDToTypeID( "mode" );
var id16 = stringIDToTypeID( "blendModel" );
var id17 = stringIDToTypeID( mode);
desc5.putEnumerated( id15, id16, id17 );
// pressure for size
desc5.putBoolean( stringIDToTypeID( "usePressureOverridesSize" ), pfs );

var id18 = stringIDToTypeID( "null" );
desc226.putObject( id12, id18, desc5 );
executeAction( idset, desc226, DialogModes.NO );
}

setSmudgeOptions("smudgeTool","lighten",20,false);

Everything works except for the Strength setting. I've tried the function with "strength" changed to "opacity" (and uppercase variations).

I would very much appreciate some help (I don't know where to find this sort of information). I've looked through this forum and also the Photoshop Scripting forum without any luck.

Thanks

Robert