Hello i need help to make a loop script to sendinput whats inside MyListBox , but i want it to send them like this first name in line 1 - second name in line 2 etc
And send a string before every input
for example if i had a list box that has names like "Nike roger roy and the string was Hello the scripts should do this :
Hello Nike
Hello roger
Hello roy
loop script
-
- Posts: 57
- Joined: 09 Oct 2017, 13:34
Re: loop script
Do you mean like this?
Code: Select all
MyListBox = Nike|roger|roy
Gui, Add, ListBox, vMyListBoxItem, %MyListBox%
MyString = Hello
Loop, parse, MyListBox, |
{
SendInput, %MyString% %A_LoopField%`n
}
Last edited by Osprey on 23 Nov 2017, 20:11, edited 1 time in total.
-
- Posts: 57
- Joined: 09 Oct 2017, 13:34
Re: loop script
No i need to send just the names in the ListBox 1 time.
Re: loop script
That's what it does. If the listbox (technically, the string that the listbox uses) contains the names Nike, roger and roy (Nike|roger|roy), it prints out...
Hello Nike
Hello roger
Hello roy
...one time. Have you tried running it?
Hello Nike
Hello roger
Hello roy
...one time. Have you tried running it?
-
- Posts: 57
- Joined: 09 Oct 2017, 13:34
Re: loop script
i have 1 edit box and the input from that edit is sent to the Listbox now i only need to press a button and all the names in my listbox will be sent with a string using SendInput thats all...
-
- Posts: 57
- Joined: 09 Oct 2017, 13:34
Re: loop script
i did try this, but it does't work it only sends the names wrong
Code: Select all
Vouch:
MyString = Hello
Loop, parse, MyListBox, |
{
SendInput, %MyString% %A_LoopField%`n
}
return
Re: loop script
Hi,
Use ControlGet,, List to retrieve all the entries of a listview control:
Use ControlGet,, List to retrieve all the entries of a listview control:
Code: Select all
boolean = 0
string = Hello
values = a|b|c|d|e|f
Gui, Add, ListBox, w400 h400 vMyListBox +hwndLVID, ; +hwndID strores listview ID in LVID
Gui, Add, Button,, send_to_listbox
Gui, Show, AutoSize
return
Buttonsend_to_listbox:
GuiControl,, MyListBox, %values%
boolean = 1
return
#If boolean
F2::
ControlGet, list, List,,, ahk_id %LVID% ; to operate upon a control's ID, one can use ahk_id %ControlID% for the WinTitle parameter
Loop, Parse, list, `n
MsgBox, %string% %A_LoopField%.
return
#If
-
- Posts: 57
- Joined: 09 Oct 2017, 13:34
Re: loop script
This doesn't work only prints out abcdef when i press Buttonsend_to_listbox:
Re: loop script
...and when you press F2 what's happenMightykiller wrote:This doesn't work only prints out abcdef when i press Buttonsend_to_listbox:
Who is online
Users browsing this forum: skeerrt and 137 guests