5 Replies Latest reply on Jan 19, 2017 9:47 PM by JJMack

    sampledData

    EnsilZah_ Level 1

      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.

        • 1. Re: sampledData
          JJMack Most Valuable Participant

          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

          Capture.jpg

          • 2. Re: sampledData
            EnsilZah_ Level 1

            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.

            • 3. Re: sampledData
              JJMack Most Valuable Participant

              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?

              • 4. Re: sampledData
                EnsilZah_ Level 1

                Well, there is a current Tool Preset, in the sense that if I select one in the Tool Presets panel there is a Tool Preset highlighted, and will remain highlighted as long as I don't modify any of its attributes.

                And I would like it to give me its Name and ID, and not step out of the vehicle.

                 

                I suppose that if I can get an event whenever the user picks a Tool Preset, and keep track of it, and make sure the user hasn't changed anything afterwards, I could gain access to what I seek.

                 

                I guess I missed the fact that there is no such thing for a Brush Preset either because I managed to get the information I wanted in other ways.

                • 5. Re: sampledData
                  JJMack Most Valuable Participant

                  EnsilZah_ wrote:

                   

                  Well, there is a current Tool Preset, in the sense that if I select one in the Tool Presets panel there is a Tool Preset highlighted, and will remain highlighted as long as I don't modify any of its attributes.

                  And I would like it to give me its Name and ID, and not step out of the vehicle.

                  Yes you can see that in Photoshop Tool Presets UI however you can not retrieve if any an tool preset is highlighted  in a script. You can not even find out if current tool only is checked or not as far as I know.

                   

                  EnsilZah_ wrote:

                   

                  I suppose that if I can get an event whenever the user picks a Tool Preset, and keep track of it, and make sure the user hasn't changed anything afterwards, I could gain access to what I seek.

                  Users can change brushes from the Brush Palette, The Brush Presets palette and actions and scripts can change tools and brushes.  IMO the best Place to see the current Brush is looking at the Brush palette it shows a stroke the current brush produces. If a users has setup Tool Presets fo brushes the know what the brush does. All they need is a quick way to select Tool Presets.  They do not need a thumbnail view.  Thumbnails take up too much display space.   If you want tool preset in screen I feel Adobe does it right a tool icon and preset name list.