I still get the same result, which results in the cursor moving to the left and still no highlighting. Furthermore, supposing the highlighting did work, the cursor doesn't move to the left until after the function completes, however I want the highlighting to occur instantly after the sendinput function is called.

Is there a function that lets me highlight the previous word given the cursor position? I am trying to do this using as little resources as possible.

~thanks