To put it simply, anything used to automate via hardware or software is against the rules and will get you actioned. Macros must be setup and used within the game system. Remember blizzard banned automation for a reason. FYI the warden will detect such software or hardware and alert blizzard

New User Interface and Accessibility Options in Dragonflight - Hold to Cast,...
This week's Dragonflight Alpha update brings with it a handful of brand-new accessibility options. Alongside further UI customization, players have new options to enable Hold to Cast, Auto Target enemies, and a hotkey to Interact with nearby objects!