Getting the name of the current brush preset
I'm using Kyle T. Webster's brush packs and I'm trying to write a script that will grab the name of the selected brush preset. The below code is the closest I've come, but it returns the wrong name:
var ref = new ActionReference();
ref.putEnumerated(charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt"));
var toolDesc = executeActionGet(ref).getObjectValue((stringIDToTypeID('currentToolOptions')));
var brushDesc = toolDesc.getObjectValue(stringIDToTypeID('brush'));
var name = brushDesc.getString(stringIDToTypeID('name'));
For instance, if I select "Kyle's Inbox - Fountania Soft", the above will output "ktw large pencil". I'm assuming the latter is some kind of internal ID, but for the purpose of my script, I would like to have the user-visible preset label. Does anyone know how I could achieve that? Thank you!
