like this GitHub - hatashiro/kawa: A macOS input source switcher with user-defined shortcuts.
the action does not matter, but maybe I misunderstood what you want to achieve
I want to switch languages (keyboard layout) by explicit shortcut
for example
⌘+^+1 = English
⌘+^+2 = German
⌘+^+3 = Ukrainian
this application GitHub - hatashiro/kawa: A macOS input source switcher with user-defined shortcuts. does precisely that