Clear debug window by code

Hello
is there a method to clear the debug window by code?
Thank yoy
KR

Within the editor you can do:

RED.actions.invoke("core:clear-debug-messages")

But why do you want to do that via code? Node's should not take it upon themselves to clear the debug sidebar.

it gives me thie error:
"TypeError: Cannot read property 'invoke' of undefined"

I want to clear the debug window in certain cases I have few debug objects but i want to focus in one and clear the window in a function before this one

Ah you want to do this in a flow?

You can't. The code I provided is how you do it in the editor. Flows don't have any access to the editor.