I’m trying to detect if a pattern name exist on Photoshop but right now I’m not able to do it, anyone have any clue of how to do it?
Right now I have this:
function selectPattern(ptrn) {
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putName(charIDToTypeID('Ptrn'), ptrn );
desc.putReference( charIDToTypeID( "null" ), ref );
executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );
}
but every time I use it the pattern name can’t be found, it’s used something like this:
selectPattern('Gauze');
Thanks in advance
2
Answers
It’s the same script as in this question. You can get the list of different presets from
Application
action reference:Whilst this doesn’t directly answer your question it may be useful to you:
You can find out a pattern’s ID with the scriptListener.