send read value to screen?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
mgroen
Posts: 97
Joined: 13 Jul 2018, 02:22

send read value to screen?

18 Jul 2018, 10:12

I have following code:

Code: Select all

^j::
FileSelectFile, FilePath
Loop, Read, %FilePath%
{
	;Any code that needs to be executed for each line of the CSV file goes here
	MsgBox, row contains value: %A_LoopReadLine%	
	Send, %A_LoopReadLine%
}
MsgBox, Done!
return
the MsgBox displays the read value (captured in %A_LoopReadLine% on screen (OK), however when I want to use Send command and display the read value on Notepad, it doesn't display anything..

Anyone who can help me with this?
gregster
Posts: 8990
Joined: 30 Sep 2013, 06:48

Re: send read value to screen?

18 Jul 2018, 11:46

Seems to work for me. To send to Notepad, the Notepad window (or any other window which accepts key sendings) needs to be active at the moment the Send command executes. If it was active before the msgbox appeared, it should get active again right after you clicked 'Ok'. A Sleep might help, if this goes too fast... not necessary in my case, though.

If some other window gets active instead, you might need to use WinActivate to make sure that Notepad is the active window.
mgroen
Posts: 97
Joined: 13 Jul 2018, 02:22

Re: send read value to screen?

19 Jul 2018, 03:06

thanks, it worked (made a small mistake in the first instance, sorry about that)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 310 guests