07-23-2017, 03:43 AM
Not quite what I was looking for. The goal is to enter in PC names into each line and then run a series of commands on the first line then once that is done go to the second one on the list. I've been trying to get this to work so I can enter 1 number then {enter} {enter}r then 2 {enter} {enter} then 3 {enter} {enter} in a notepad and this is what I got so far and I am stumped.
\Dialog_Editor
str dd=
BEGIN DIALOG
0 "" 0x90C80AC8 0x0 0 0 146 116 "Dialog"
3 Edit 0x54231044 0x200 24 40 96 48 ""
100 Button 0x54030001 0x4 20 92 48 14 "OK"
2 Button 0x54030000 0x4 80 92 48 14 "Cancel"
END DIALOG
DIALOG EDITOR: "" 0x2040202 "*" "" "" ""
str controls = "3"
str e3
str pc
foreach pc e3
mac "sub.Macro" pc
if(!ShowDialog(dd &sub.DlgProc &controls )) ret
#sub DlgProc
function# hDlg message wParam lParam
sel message
case WM_INITDIALOG
case WM_DESTROY
case WM_COMMAND goto messages2
ret
messages2
sel wParam
case 100
str e3.getwintext(id(3 hDlg))
mac "sub.Macro" e3
case IDCANCEL
ret 1
#sub Macro
function str'e3
opt err 1 ;;on error continue
spe 1000 ;;wait 1 second after commands
Wait for Notepad window max 5 s
wait 2.5 WA "Notepad"
Wait 1.5 s
1.0
run "NOTEPAD"
key F"{e3}"
key Y
key Y
\Dialog_Editor
str dd=
BEGIN DIALOG
0 "" 0x90C80AC8 0x0 0 0 146 116 "Dialog"
3 Edit 0x54231044 0x200 24 40 96 48 ""
100 Button 0x54030001 0x4 20 92 48 14 "OK"
2 Button 0x54030000 0x4 80 92 48 14 "Cancel"
END DIALOG
DIALOG EDITOR: "" 0x2040202 "*" "" "" ""
str controls = "3"
str e3
str pc
foreach pc e3
mac "sub.Macro" pc
if(!ShowDialog(dd &sub.DlgProc &controls )) ret
#sub DlgProc
function# hDlg message wParam lParam
sel message
case WM_INITDIALOG
case WM_DESTROY
case WM_COMMAND goto messages2
ret
messages2
sel wParam
case 100
str e3.getwintext(id(3 hDlg))
mac "sub.Macro" e3
case IDCANCEL
ret 1
#sub Macro
function str'e3
opt err 1 ;;on error continue
spe 1000 ;;wait 1 second after commands
Wait for Notepad window max 5 s
wait 2.5 WA "Notepad"
Wait 1.5 s
1.0
run "NOTEPAD"
key F"{e3}"
key Y
key Y
