Skip to main content
Inspiring
December 8, 2018
Question

Select Tool Preset Via Script

  • December 8, 2018
  • 4 replies
  • 2414 views

Hi there

Is it possible to select a Tool Preset (not Brush Preset) using a script?

Let's say I have a Brush tool preset named "My Brush" and also an Eraser tool preset named "My Eraser" and also a MixerBrush tool preset named "My Mixer", etc. etc. and so on.

Right now I have thousands of tool presets and scrolling through the list to find what I want is almost impossible now, there are too many.

Is there a quick way to just select any of those presets by a script? 

Thank you

This topic has been closed for replies.

4 replies

gangeekAuthor
Inspiring
December 11, 2018

thanks to all of you. You have all provided much information on this. I will take the time to research through all of your suggestions and then will reply here once a solution is found.

Thank you

Brainiac
December 9, 2018

Here Re: get toolpresets for certain tool

you can find a lot of useful things.

JJMack
Adobe Expert
December 9, 2018

Cycle Tool Presets Package Added Sept. 6, 2017

Contains

  • CycleTool.jsx - Tool Presets cycling function need to be included in your Tool Presets script
    Include four Tool Presets cycling scripts for four free tools Presets sets I downloads from the web
  • CycleBrushes.jsx - Cycle presets in tool preset set the_sketch_arsenal_by_thatld.tpl
  • the_sketch_arsenal_by_thatld.tpl - need to be in the scripts folder
  • CycleMixerBrushes.jsx - Cycle presets in tool preset set Yngvar_BasicMixerBrushes.tpl
  • Yngvar_BasicMixerBrushes.tpl - need to be in the scripts folder
  • CyclePencilBrushes.jsx- Clocker presets in tool preset set CS1_Pencil_Presets.tpl
  • CS1_Pencil_Presets.tpl - need to be in the scripts folder
  • CycleWaterBrushes.jsx- Cycle presets in tool preset set alenah_watercolor511(set_of_3_brushes).tpl
  • alenah_watercolor511(set_of_3_brushes).tpl - need to be in the scripts folder
  • CycleToolsPresets.html- This brief write up
  • CycleBrushes.gif - Animated Gif use in the above html file

Download

JJMack
gangeekAuthor
Inspiring
December 9, 2018

but how do any of those scripts allow me to choose an individual tool preset via scripting?

JJMack
Adobe Expert
December 9, 2018

BY assigning an F fey shortcuts for a tool  when you use the shortcut you can cycle through your list of presets for that tool So you can sete different function keys for different tools switch between tools and their presets switching tool will not cycle to the next preset but resume with the tool current setting  using the shortcut again will cycle to next or previous if you add a modifier key to the shortcut (Shift , Alt or Ctrl)

JJMack
gangeekAuthor
Inspiring
December 8, 2018

The only way I can figure this out is to use the scriptlistener and adjust as necessary. This code works, but you must un-check "Current Tool Only" in the Tool Presets Panel for this to work correctly as I can't figure out a way to un-check it using a script. Maybe someone can fill that part in..

Anyhow all you need to is paste in the name of your tool preset inside the quotations:

var FIVE = charIDToTypeID( "slct" );

    var SIX = new ActionDescriptor();

    var SEVEN = charIDToTypeID( "null" );

        var EIGHT = new ActionReference();

        var NINE = stringIDToTypeID( "toolPreset" );

        EIGHT.putName( NINE, "ENTER YOUR TOOL PRESET NAME HERE" );

    SIX.putReference( SEVEN, EIGHT );

executeAction( FIVE, SIX, DialogModes.NO );

Stephen Marsh
Adobe Expert
December 9, 2018

I looked in the DOM reference but could not find any reference to tool presets, so it appears that AM code is the only way to script… Which begs the question, what does this gain over simply using an action in the first place?

gangeekAuthor
Inspiring
December 9, 2018

I need to select a tool preset via a .jsx script if possible, not via actions. I want to be able to run this .jsx script via a 3rd-party application. The code I posted indeed works, but the only barrier to it is that "Current Tool Only" needs to be un-checked at all times. I can't find a way to ensure that it is unchecked at all times using a script.