
The "surround" version is experimental.  It's very complicated and tries to do too much, so it's more likely to fail.

It attempts to detect if any text is selected, and then, depending on the shortcut, attempts to put single, double or German quotes on either side of selected text.  Depending on the shortcut, it can also attempt to detect if the selected text accidentally includes a space.

With this version:

Ctrl+( = changes asdf to ‘asdf’, does not check for trailing space
Ctrl+) = changes asdf to ‘asdf’, excludes trailing space if present
Shift+Ctrl+( = changes asdf to “asdf”, does not check for trailing space
Shift+Ctrl+) = changes asdf to “asdf”, excludes trailing space if present
Shift+Ctrl+" = changes asdf to „asdf“, does not check for trailing space
Shift+Ctrl+; = changes asdf to „asdf“, excludes trailing space if present

As it uses the clipboard, whatever was on the clipboard is lost.

Sometimes, the Windows clipboard is slower and then the script won't work unless you increase the Sleep cycles near the top of the .AU3 file.

The script uses paste to insert the characters, and some programs insert additional spaces when you paste (e.g. Microsoft Word when smart cut and paste is enabled).

Obviously, if you select text but then use a shortcut that isn't a quote, the selected text will be replaced with the character that you're trying to insert.






