Skip to main content
Participating Frequently
July 8, 2013
Question

Need help with querying brush presets info

  • July 8, 2013
  • 1 reply
  • 965 views

Hi,

I'd like to get the information of brushes from Brush Presets. This information includes names, brush size, hardness, spacing, flip, etc...

I've search through the discussion and I'm aware that the best way is to parse/read the abr files manually. Unfortunately, I can't find the file specifiations. The example from Gimp was for an older version of Photoshop ABR I guess. Anyone has any working code/specs that could be shared?

If the above is not visible, I'm wondering if there is an alternative way that I could get the brushes information without activating them and getting it from currentToolOptions via the script?

So far, I only found how to get the names in the Brush Presets via presetManager and only names are available for querying. Am I missing something? And is it do-able?

Your help is very much appreciated.

This topic has been closed for replies.

1 reply

ericpohAuthor
Participating Frequently
July 10, 2013

Hi guys,

Maybe I rephrase my question/scenario.

I know I can get the list of brush names via this...

function brushName() {
   var presetNames = [];
   var ref = new ActionReference();
   ref.putEnumerated(charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt"));
   var desc = executeActionGet(ref);
  var List = desc.getList(stringIDToTypeID('presetManager'));
  var list = List.getObjectValue(0).getList(charIDToTypeID('Nm  '));
  for (var i = 0; i < list.count; i++) {
    presetNames.push(list.getString(i));
  }
  return presetNames;
}

I wonder if I could also get the brushes details (hardness, size, spacing, etc..) via script?

Your help is very much appreciated.

Inspiring
July 10, 2013

As far as I know, Adobe has never made the ABR file spec public. And the presetManager does not have those details. So you will either need to select a preset and get the tool options or try to update the code you have for parsing the ABR file.

I don't remember seeing a parser for abr files posted anywhere but I would expect any that do exist would be old or at least before getting the current tool options was added to the scripting model.