Quick Tip: The Best Way to Paste with the AutoHotkey Send Command

When Using the Send Command to Paste from the Clipboard, a Simple Best Practice Can Make the Difference

tipsI’ve noticed that occasionally a couple of my Clipboard paste Hotkeys would cause a jump to the Bottom of the page in the WordPress editing window—a huge source of aggravation. Fortunately, I rarely used those Hotkeys. Then, while working on my blog for next week, I ran into the problem again in a simple capitalization Hotkey routine. This confused me since my standard uppercase, lowercase, and initial cap Hotkeys work just fine. The new Hotkey wasn’t that much different. I investigated.

It turns out that in the older working Hotkeys I sent the Clipboard variable to insert the text into the document:

Send %Clipboard%

while I used the Windows key combination Ctrl+V to paste the text in the newly created Hotkey:

Send ^v

If I used the first paste format with the variable Clipboard, it worked without a problem in WordPress. But, if I used the second Windows shortcut paste (Ctrl+V), it caused that maddening jump to the bottom in WordPress.

[Comment from Denis Lamarre: I suggest using “SendInput %Clipboard%” instead of “Send %Clipboard%”. It is generally faster and more reliable. In addition “SendInput” buffers any physical keyboard or mouse activity during the send, which prevents user keystrokes from being interspersed with those being sent.]

Note: Both forms worked fine in the other non-WordPress editors I tested.

I changed Send ^v to Send %Clipboard% in the new script and resolved the problem.

I now consider using Send %Clipboard% in place of Send ^v a best practice in AutoHotkey scripting.

Click the Follow button at the top of the sidebar on the right of this page for e-mail notification of new blogs. (If you’re reading this on a tablet or your phone, then you must scroll all the way to the end of the blog—pass any comments—to find the Follow button.)

jack

This post was proofread by Grammarly
(Any other mistakes are all mine.)

(Full disclosure: If you sign up for a free Grammarly account, I get 20¢. I use the spelling/grammar checking service all the time, but, then again, I write a lot more than most people. I recommend Grammarly because it works and it’s free.)

Buy Jack a Cappuccino!

If you found a blog particularly useful, show your appreciation by buying Jack a cup of coffee! Or, if you prefer something for yourself, check out his books.

$4.00

Find my books at ComputorEdge E-Books!

11 thoughts on “Quick Tip: The Best Way to Paste with the AutoHotkey Send Command

  1. Nice column and tips Jack. I’ve noticed that sending Hotstrings in Word is very slow at times so I will try Sending %Clipboard%.

    Best Regards.

    *~Dale*

    *Dale Winchell*

    On Wed, Mar 4, 2020 at 1:33 PM Jack’s AutoHotkey Blog wrote:

    > Jack Dunning posted: “When Using the Send Command to Paste from the > Clipboard, a Simple Best Practice Can Make the Difference I’ve noticed that > occasionally a couple of my Clipboard paste Hotkeys would cause a jump to > the bottom of the page in the WordPress editing window—a hu” >

    Like

  2. I suggest using “SendInput %Clipboard%” instead of “Send %Clipboard%”. It is generally faster and more reliable. In addition “SendInput” buffers any physical keyboard or mouse activity during the send, which prevents user keystrokes from being interspersed with those being sent.

    Liked by 1 person

  3. I would update the original post to reflect this important point (use SendInput instead of Send) [people are most likely not reading all the comments]

    Like

  4. I prefer in some case real pasting instead of sendinput %clipboard% because send will type the keys one by one and pasting in one step is much faster.
    The difference you notice here with Ctrl+V is because it pastes the clipboard in rich text format where send %clipboard% will always paste in plain text.
    I recommend using the WinClip library [https://autohotkey.com/board/topic/74670-class-winclip-direct-clipboard-manipulations/] (although there are some issues with it.) see https://tdalon.blogspot.com/2020/02/autohotkey-clipboard-handling.html

    Like

  5. What if you have “SendMode Input” at the very top of the script and use “Send Ctrl+v” would you still run into the same issue?

    Like

      • Yes, I was merely pointing out that the “SendMode Input” command does not make a difference. As far as sending text only, I understand the difference between ^v and %clipboard%. I have written about the various Clipboard scripts in the past but the vast majority of the clipboard routines I use only send text.

        Like

  6. In Excel
    But it jump to another cell after completing command
    is there any trick to keep it on the same cell

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s