Voice control custom command with variable?
I've got something workable by using &quot;Run Workflow&quot; and the following Apple Script&quot;:
on run {input, parameters}
    activate application &quot;IntelliJ IDEA CE&quot;
    tell application &quot;System Events&quot; to key code 123 using {option down} -- left arrow for back word
    tell application &quot;System Events&quot; to keystroke &quot;:&quot;
    tell application &quot;System Events&quot; to key code 124 using {option down} -- right arrow for fwd word
    -- https://apple.stackexchange.com/questions/36943/how-do-i-automate-a-key-press-in-applescript
    return input
end run

I just have to say the word &quot;foo&quot; as normal then speak a subsequent command &quot;to keyword&quot;, which converts the previous word to a keyword using a sequence of three key presses as above.