Hi Adam, Jan,
you have to modify the macro where the paintbrush tool is defined (i.e.,
your StartupMacros.txt).
The easiest way would be to add your macro this macro file, then you can
directly set the variable brushWidth.
If you want to have your macro separate from the StartupMacros, you need a
mechanism to pass the variable to that macro. You could use the Prefs for
this:
Add the following to the macro "Paintbrush Tool" in StartupMacros.txt as
the first line:
brushWidth = call("ij.Prefs.get", "startup.brush", "10");
Add the same line to the "Paintbrush Tool Options" macro (again, as the
first line after the opening curly bracket).
In your macro, write
call("ij.Prefs.set", "startup.brush", brushWidth);
where brushWidth is the desired value to be used for the brush size.
Then, this brush size will be effective the next time that the user paints
something in the image (unless (s)he changes it by double clicking the
icon).
Hope this helps,
Michael
_____________________________________________________________________
On Tue, November 16, 2010 10:49, Jan Eglinger wrote:
> Hi Adam,
>
> did you try:
>
> setTool(19);
>
> You can get the ID of the currently selected (macro-)tool with:
>
> print(toolID);
>
> However, since the Paintbrush Tool is defined in
> "./macros/toolsets/Drawing Tools.txt", I don't know how to set it's
> width from another macro.
>
> Cheers,
> Jan
>
>
>
> On 16.11.10 05:07, Dr Adam Cliffe wrote:
>> Does anyone know a good way of selecting the Paint Brush tool from a
>> macro, and also setting its width?
>> (not the brush tool)
>>
>> Thanks
>>
>> Adam
>