Enter names sequentially from a file Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Fulminare
Posts: 369
Joined: 26 Jun 2021, 20:15

Enter names sequentially from a file

Post by Fulminare » 20 May 2022, 23:04

Hello !

Code: Select all

^y::
loop, 5
{
MouseClick, left, 151, 119
Send, ;Names from a file (one after the other)
sleep 1000
send, {Enter}
sleep 1000
Send, ;Message
Sleep, 1000
send, {Enter}
Sleep 2000
}
Return
There are a list of names in an excel file.
Can someone kindly tell me, what should I use to send the names one by one in a loop ?

eg :
Danny
Robert
Juan
Ivan
sophia

In the first loop "Danny" should be sent
in the second loop "Robert"
so on and so forth

Regards.

User avatar
boiler
Posts: 16957
Joined: 21 Dec 2014, 02:44

Re: Enter names sequentially from a file  Topic is solved

Post by boiler » 20 May 2022, 23:50

Code: Select all

#SingleInstance, Force
SendMode Input
SetWorkingDir, %A_ScriptDir%
NameList =
(
Danny
Robert
Juan
Ivan
sophia
)
; replace above with: FileRead, NameList, MyNameFile.txt
Names := StrSplit(NameList, "`n", "`r")
return

^y::
for Each, Name in Names
{
MouseClick, left, 151, 119
Send, % Name
sleep 1000
send, {Enter}
sleep 1000
Send, ;Message
Sleep, 1000
send, {Enter}
Sleep 2000
}
Return

Fulminare
Posts: 369
Joined: 26 Jun 2021, 20:15

Re: Enter names sequentially from a file

Post by Fulminare » 20 May 2022, 23:55

This is so simple
I was thinking on the lines of Fileread e.t.c
Thanks a lot Boiler. It works brilliantly

Post Reply

Return to “Ask for Help (v1)”