How to get all brush or tool presets?

Is there a way to get tool/brush preset list? Thought maybe it’s not in Alchemist app properties list and tried toolPreset & toolPresets, but it seems there are no such properties indeed. I’d like to get the list of these presets and then allow to select them with a click of the button in a panel

Yes, there is. Since you are developing (have developed) a competing product that seems to have the same features as my plugin, I’m not sure if I should tell you how to do it :wink:

1 Like

I understand Thomas’ point of view, but honestly, seeing @Jarda’s reaction to Thomas’ comment is very disappointing and discouraging :frowning: This makes me think, that help is prioritised based on the earlier relationship between devs. Especially when Jarda is now on Adobe team :frowning:

1 Like

I am not judging who’s project is better or who should give advice under what circumstances. I just found out that reaction was funny and interesting. If you two would switch names on this topic my reaction would be the same. That is all :smiley:

Also, my contract expired. I am not on the Adobe team anymore.

Apparently you’re looking for something besides this, but maybe this will help someone else.

image

I thin it is even twice there

const {batchPlay} = require("photoshop").action;

const result = await batchPlay(
   [
      {
         _obj: "get",
         _target: [
            {
               _property: "presetManager"
            },
            {
               _ref: "application",
               _enum: "ordinal",
               _value: "targetEnum"
            }
         ],
         _options: {
            dialogOptions: "dontDisplay"
         }
      }
   ],
   {}
);

const pinned = result[0].presetManager[0];
const {batchPlay} = require("photoshop").action;

const result = await batchPlay(
   [
      {
         _obj: "get",
         _target: [
            {
               _property: "brushes"
            },
            {
               _ref: "application",
               _enum: "ordinal",
               _value: "targetEnum"
            }
         ],
         _options: {
            dialogOptions: "dontDisplay"
         }
      }
   ],
   {}
);

const pinned = result[0].brush;
1 Like

Did not know that :frowning:
In any case, I consider you as one of the very best devs for Ps and seeing this reaction made me feel sad, especially when I was assuming you knew what the solution was :man_shrugging: I hope you can understand my reaction from my point of view :confused:


Was looking into it, but it’s only for currently selected tool


I don’t think I noticed presetManager property in Alchemist :face_with_monocle: Will double check later in the evening, but sounds like exactly what I was looking for. Thank you so much! :bowing_man: I didn’t check brushes at all I think - will check also :pray:

1 Like

It seems presetManager has all the info I need. And I see it’s in Alchemist. Probably missed it when I didn’t know what exactly I was looking for :frowning:

Also in your example for brushes you use brushes, but in Alchemist it’s brush. Both return exact same brush data. Just an alias? :thinking:

You can check for their typeID to find out. If both share same typeID then it is an alias.

Not sure what you mean by that. Where would I look for that typeID?

https://developer.adobe.com/photoshop/uxp/2022/ps_reference/media/photoshopaction/#getidfromstring

1 Like

I noticed, that preset selection does not differentiate if there are multiple presets with the same name. Same with brushes. Descriptors are:

{
   "_obj": "select",
   "_target": [
      {
         "_ref": "toolPreset",
         "_name": "Tool Preset Name"
      }
   ]
}

{
   "_obj": "select",
   "_target": [
      {
         "_ref": "brush",
         "_name": "Brush Name"
      }
   ]
}

Is there a way to specifically define which brush/preset to select if there are multiple by the same name?

With layer styles… patterns have their own GUID and that can be used instead of name. But for tool presets… good luck… choose very unique names.

1 Like