Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Select Tool Preset Via Script

Contributor ,
Dec 08, 2018 Dec 08, 2018

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

TOPICS
Actions and scripting
2.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Contributor ,
Dec 08, 2018 Dec 08, 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 );

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 08, 2018 Dec 08, 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 09, 2018 Dec 09, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 09, 2018 Dec 09, 2018

There is no way to record this via an action, and unless I am missing something the AM code recorded by ScriptListener has the same limitation.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 09, 2018 Dec 09, 2018

Bonjour

Can be a solution HERE !

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 08, 2018 Dec 08, 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 09, 2018 Dec 09, 2018

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 09, 2018 Dec 09, 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Dec 09, 2018 Dec 09, 2018

Here Re: get toolpresets for certain tool

you can find a lot of useful things.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 10, 2018 Dec 10, 2018
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines