Use Python to Select Certain Tool OR One Shortcut for Multiple Actions

Simply put, I’m trying to make it so that whenever I select the Brush Tool, and Eraser Mode is turned on, Eraser Mode will turn off every time.

I was thinking of something like this:

eraseAction = Application.action("erase_action")

if (eraseAction.isChecked()):


If this isn’t possible, is it possible to have one shortcut activate multiple actions?

Also, whenever I run a script via Ten Scripts, I get a dialog box that says:

Script <path-to-script> executed

Is there a way to get rid of this dialog box?

I guess the only way to achieve that is using python scripting.
How did you came up with “freehand_brush”? After running:
[print([a.objectName(), a.text()]) for a in Krita.instance().actions()]
copying the output somewhere and doing ctrl+f, you get the “erase_action”, but freehand brush is called “KritaShape/KisToolBrush”.
I would also change the order to make sure the eraser action is changed after changing the tool, so the whole code should be:

from krita import *
eraseAction = Krita.instance().action("erase_action")
if (eraseAction.isChecked()):

This Ten Script dialog is something that makes it unusable in my opinion, and I wonder why it haven’t be removed so far. You can avoid it by making a proper krita extension out of the script. You can find out how to do it in krita manual or downloading my extension - contains 4 actions like this, you only need to add one, and there is a manual how to turn it on there.