Characters/Formatting – language-specific quotation marks

^2::    ; SELECT TEXT TO BE IN QUOTATION MARKS
        ; AND PRESS CTRL-2
        ;-------------------------------------
    KeyWait Ctrl
    temp := ClipboardAll
    clipboard =
    send ^c
    ClipWait, 1
    NrSteps := StrLen(clipboard)
    Send {Left}
    Send „ ;----opening quotes----
    Send {Right %NrSteps%}
    Send “ ;----closing quotes----
    clipboard := temp
        temp =
    return

I confess, this is a rather primitive script. But very helpful. You just need to exchange the characters (may also be multiple characters) for your language. The advantage is: It works everywhere.

  • Thank you, Horst, works like a charm.

    I had to change the shortcut (Alt + W). It was probably conflicting with Dragon Naturally Speaking on my machine.

    Because I use French quote (« word in quote ») and there is a space after the first quote and before the last one, I have modified the script to reflect those spaces:

    !w:: ; SELECT TEXT TO BE IN QUOTATION MARKS
    ; AND PRESS ALT-W
    ;-------------------------------------
    KeyWait Ctrl
    temp := ClipboardAll
    clipboard =
    send ^c
    ClipWait, 1
    NrSteps := StrLen(clipboard)
    Send {Left}
    Send «{SPACE} ;----opening quotes----
    Send {Right %NrSteps%}
    Send {SPACE}» ;----closing quotes----
    clipboard := temp
    temp =
    return

    Thanks again, Horst :)