Add tags with a single keystroke

Here's one  and I collaborated on. We've been meaning to write about it in our blogs, but here it is in the meantime. Further explanation to come in the blog article, but in a nutshell it allows you to insert tags sequentially by pressing a single key while ignoring placeables. As you can see, this script uses the Left Windows key.

The script assumes that the default Ctrl+Enter shortcut is used to confirm segments. If a different shortcut is used, it needs to be replaced accordingly on the last line of the script.

;Add tags with LWin key

n:=1
return

Lwin::
if (n = 1)
Send, ^!{Right}{Esc}{Right}
else
{
Send, {Ctrl Down}{Alt Down}{Right %n%}
Sleep 200
Send, {Ctrl Up}{Alt Up}{Esc}{Right}
}
n++ ; increment n
return

~^Enter::n := 1 ;script is reset with Confirm and Move to Next Segment shortcut, tilde is needed to pass through the original action for Ctrl+Enter

Parents Reply
  • Hi Nora,

    that works famously. Thank you so much!

    Initially I was a little confused as to why this script looks rather different than the other one. I know AHK has several methods of pushing keystrokes into the UI, but maybe you could comment a little?!

    When I was tinkering with your original script the other day, I tried to mod it by adding in

    Send ^a
    Pause 20

    or something similar. But that wouldn't highlight the text. Maybe the break was too short. In any case the script would sometimes run ok, but then run crazy often enough. You could watch it highlight the tags one after another in a merry go round.



    Kind regards,
    Matthias
Children