Pasting in ControlSend not working?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Kladdkaka
Posts: 1
Joined: 12 Dec 2017, 07:42

Pasting in ControlSend not working?

12 Dec 2017, 08:17

So I have this list of numbers in Excel right, and I want to copy one number, paste it into another program, press some buttons, and then have the script return to Excel again to the next number (hence the {down}).

I made a very crude script yesterday that just tabbed between Excel and the program I´m using, but I felt that AHK was capable of way more, so I decided to do it this way instead:

Pause::
Send ^c <<<< in Excel
SetTitleMatchMode, 2
sleep, 50
ControlSend, Edit1, ^v, Notepad
sleep, 50
ControlSend, Edit1, {Enter}, Notepad
sleep, 50
ControlSend, Edit1, Y, Notepad
sleep, 50
ControlSend, Edit1, {Enter}, Notepad
Sleep, 50
Send, {down} <<<< again in Excel
return

It does every command correct in the other program except for pasting.
The script above currently produces this in Notepad when performing the script:

Y

Y

Y

It should look like this:
--Copied number--
Y
--Copied number--
Y
--Copied number--
Y

What gives?
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Pasting in ControlSend not working?

12 Dec 2017, 09:36

Have a try with ControlSetText instead.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Anput, Google [Bot] and 88 guests