[Gimp-user] change active tool from script

David Gowers 00ai99 at gmail.com
Tue May 19 17:08:51 PDT 2009


Hi Ryan,

On Wed, May 20, 2009 at 9:22 AM, Ryan Krauss <ryanlists at gmail.com> wrote:
> I would like to be able to easily toggle between the Paintbrush with brush
> Circle (05) and an Eraser with brush Circle (17).  I want to write one
> script for each and bind them to keys I can use to make this switch
> quickly.   I have found the commands to set the brushes to either Circle
> (05) and Circle (17) and have written that part of each script and bound
> them to Alt-1 and Alt-2, so I can quickly change between the two brush
> radii, but I can't seem to find script fu commands to set the active tool to
> either Eraser or Paintbrush.  Is there a way to do that from a script?

No (and AFAICS, there will never be -- it has too much potential to
confuse the user and introduce race conditions.)
I was going to mention you could use xdotool to trigger the keyboard
shortcuts for Eraser or Paintbrush,
but actually you can't (not in Script-Fu; I always use Python to write
my GIMP plugins, and I can shell out to xdotool easily enough in
Python)

David


More information about the Gimp-user mailing list