Also verify that you are:
- not running any other scripts (as separate processes) which install a keyboard hook.
- not running any other programs which install a keyboard hook.
- using SendMode Input prior to Send, or SendInput instead of Send.
Otherwise, sent keyboard events will generally be interspersed with your own keyboard input.
When you mix in capital letters (you have a few), it will send Shift down or up whenever it needs to change case. Sometimes applications ignore the sequence of keyboard events and instead check the
current Shift state, so you get the wrong character if the events are sent faster than the application is processing them (although this doesn't explain how a 2 surrounded by digits and lowercase letters would be transformed to @).
{Text} mode avoids this issue because it sends character codes, not key-down and key-up messages.
SendRaw would not make any difference for what you are sending. The only difference between Send and SendRaw is that the characters
^+!#{} have special meaning to Send but not SendRaw.
I'm using the below script to copy and paste ... the script pastes
You aren't, and it doesn't. What you are doing now is effectively telling AutoHotkey to
type a long string of characters.
Send xyz will send key-down and key-up messages for x, y and z.
Imagine that AutoHotkey is sitting next to you, and you ask her to type this code for you. If you are using the default SendMode, maybe you will jump in and press keys while she's still typing the code. If you are using
SendMode Input under the right conditions, it will be like you each have your own keyboard, and any input from yours is buffered (stored for later processing) until she finishes typing.
If possible, I would like to avoid copying the text to clipboard first before pasting it since it overwrites my clipboard.
For long strings, it is pretty much always more reliable to
actually copy and paste. Ctrl+V generally requires only 4 key-down/up messages, whereas typing 42 characters requires at least 84 key-down/up messages. More events means it takes longer. The longer it takes, the higher the risk of interference or timing issues.
Typically when using the clipboard to paste text, one would save the old content with something like
ClipSaved := ClipboardAll and restore it (after a delay) with
Clipboard := ClipSaved. A delay is necessary because it takes time for the program to process the Ctrl+V keystroke and pull the text from the clipboard.