Skip to main content
Participant
June 6, 2016
Answered

get the name of active tool and set the "BRUSHSIZE" of the Freeformpen tool

  • June 6, 2016
  • 1 reply
  • 290 views

Good morning all,

I would like to use the same script to swap from "pentool" to "freeformPenTool" and "vice versa" with an "if..else" statement.

How can i get the name of  the active tool ?

then set the size of the Freeformpen tool : "PaintingCursors BRUSHSIZE" ?  (ScriptingListener doesn't record this setting).

But i have no exemple about "PaintingCursors"...

This topic has been closed for replies.
Correct answer c.pfaffenbichler
then set the size of the Freeformpen too

What is that supposed to mean? A Path has no width or brushsize per se.

How can i get the name of  the active tool ?

// 2016, use it at your own risk;

#target photoshop

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"))));

1 reply

c.pfaffenbichler
Community Expert
c.pfaffenbichlerCommunity ExpertCorrect answer
Community Expert
June 6, 2016
then set the size of the Freeformpen too

What is that supposed to mean? A Path has no width or brushsize per se.

How can i get the name of  the active tool ?

// 2016, use it at your own risk;

#target photoshop

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"))));

Participant
June 6, 2016
then set the size of the Freeformpen too

What is that supposed to mean? A Path has no width or brushsize per se.

I mean the size of circular area used by the tool to sample the image and determine where to place the path.

(Set in the "magnetism panel" of the freeformPenTool.)

thank you for the code about "get the name of  the active tool".

i try it.

c.pfaffenbichler
Community Expert
Community Expert
June 6, 2016
(Set in the "magnetism panel" of the freeformPenTool.)

Try if setting the values records with ScriptingListener.plugin, if not you may have to use Tool Presets.

Edit: I had overlooked that you mentioned in the original post that it does not record AM code.