here the command to switch
XDesktopAutomation | true
XDesktopAutomation | false
Inside the macro code to switch.
https://ui.vision/x/idehelp?cmd=xdesktopautomation