Skip to main content
Inspiring
January 16, 2017
Question

sampledData

  • January 16, 2017
  • 1 reply
  • 1429 views

So I was looking through some data generated by xbytor's Getter, for the current brush, and I saw this line:

<String symname="sampledData" sym="sampledData" string="acb05ccc-62fa-11e6-ad9e-812d3a1d6bdc"/>

I'm assuming this is a reference to some internal datastructure that stores the bitmap data for the brush, I was wondering if anyone more familiar with AM code might shed some light on the matter, and whether it's possible to access it..

On a somewhat related note, the original reason I was looking though the Getter data is to check if there's some way to get the currently selected Tool Preset.

So I'd appreciate help with that as well.

This topic has been closed for replies.

1 reply

JJMack
Community Expert
Community Expert
January 18, 2017

acb05ccc-62fa-11e6-ad9e-812d3a1d6bdc Looks like a UUID

You can get the current tool however, I do not know if you can tell if a tool preset was used to set it. Also if the current tool is a Brush type tool I do not know if you can get the tool current settings.  They seem to be visible in several areas of Photoshop UI.  Some settings In the Tool Option Bar some, some are in the Brush Palette. There is also  the Brush Preset palette and the Tool Preset palette and the are different types of brushes.  Round tip brushes, sample brushes, wet mixer brushes. IMO you are best off with Tool Presets for they store your particular setting to fot a brush. The Brush presets palette is more general as is the Brush Palette and tools option bar  these area are used for changing brush settings.  Tool Presets are your saved stored brush setting.

function currentToolName() {

var ref = new ActionReference();

ref.putProperty(stringIDToTypeID("property"), stringIDToTypeID("tool"));

ref.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );

var applicationDesc = executeActionGet(ref);

alert(typeIDToStringID(applicationDesc.getEnumerationType(stringIDToTypeID("tool"))));

}

X provided a Presets Lister that list all presets including Tool Presets.

Scripts can select current tools presets.  You can also select any tool by Photoshop tool name so a script can select any loaded preset.  Scripts can also load tool presets *.tpl file.

I do not knon much about using Action managers code executeActionGet()

UUID

JJMack
EnsilZah_Author
Inspiring
January 18, 2017

I've managed to get current Brush Preset, current Tool, but not current Tool Preset, which is what I'm specifically after.

When the current Tool Preset is a sampled brush, I am able to get a name value, but it looks like it's the name of a JPG the brush texture was saved in at some point or something and is not useful to correlate it to the specific Tool Preset.

As for the UUID, I guess I'll just hope I stumble at some point on something useful to returning what it's pointing to, if that's even possible.

JJMack
Community Expert
Community Expert
January 18, 2017

EnsilZah_ wrote:

I've managed to get current Brush Preset, current Tool, but not current Tool Preset, which is what I'm specifically after.

You need to ask yourself a question. Is there such a thing as current Tool Preset?  You know there current tool and you can get that. You know the if the current  tool is a brush tool the user  may have many tool presets loaded into Photoshop. You know the current tool has settings but are those setting the same as stored in one of the tool presets or did the user adjust the tools settings after perhaps selecting a tool preset, with the brush palette or the options bar or perhaps Alt+right-click and drag. Is there such a thing as current preset?

JJMack