Get brush via script
All the the scripts I've done for Photoshop over the years I've never needed to access brushes... until now:
// select brush by name
var idslct = charIDToTypeID( "slct" );
var desc577 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref311 = new ActionReference();
var idBrsh = charIDToTypeID( "Brsh" );
ref311.putName( idBrsh, "my fancy synthetic brush #4" ); //brush name
desc577.putReference( idnull, ref311 );
executeAction( idslct, desc577, DialogModes.NO );
So far so good, this will select a brush where "my fancy synthetic brush #4" is the name of the required brush. Nice.
I'd like to know:
Does Photoshop seem to ignore brush folder names??
And
If there are two or more brushes named the same (accidental duplicate) does it take the first one??
