Skip to main content
MISCHAMEL
Participant
August 29, 2017
Question

Set parameters opacity, flow, hardness and size for clone stamp tool in javascript code

  • August 29, 2017
  • 1 reply
  • 1249 views

A panel with buttons should set some default parameters.

So i would need access to the parameters shown in the picture and header for the clone stamp tool within a JavaScript context.

I tried to fetch the commands using the ScriptListener, but it doesn't record these parameters. Also i tried reading the official API as well as some Google FAQ research, but i could not find any working way to do that.

This topic has been closed for replies.

1 reply

JJMack
Community Expert
Community Expert
September 1, 2017

To set the different attributes of tools you best off creating tools presets and selecting tools presets. the tools settings are recorded the the tools presets and the tools setting are set from them.    Some brush type tools are script able when normal round tipped brushed are used. You can search the Scripting forum about scripting then like spacing size hardness etc.  There are quit a few thread on that subject scripting brushes. There are many Photoshop tools that are brush type tools.   The number shortcut keys can also be used to set opacity.

Starting with CC 2014 If  "(app.toolSupportsBrushes(app.currentTool))" is true then Diameter, Hardness, Angle, Roundness, Spacing, Flipy, and Flipx can be retrieved and set.   I believe all other attributes would need to be handled via Tool Presets.  I posted some code about cycling through tool presets via shortcuts for scripts. In that forum.

Re: Cycle through Tool Presets with shortcut?

JJMack
MISCHAMEL
MISCHAMELAuthor
Participant
September 5, 2017

Thanks JJMack. Your answer was very helpful.