Question regarding IF, Else
Moderators: Dorian (MJT support), JRL
The R value is conflicting with the program shortcut. What Should I edit or bring something new? R is record where 1 plays file.
Code: Select all
Dialog>dialog1
Caption=TESTER
Width=445
Height=119
Top=522
Left=798
Max=0
Min=0
Close=1
Resize=1
Label=This is an automated error checker to test programs.,88,8,true
Label=Created for ESL Department by "MY NAME",104,24,true
Button=Test,136,48,75,25,1
Button=Exit,216,48,75,25,2
EndDialog>dialog1
Show>dialog1
label>actionloop
GetdialogAction>dialog1,r
if>r=2,Cancel
if>r=1,Tester
Goto>actionloop
Label>exit
SRT>Cancel
Closedialog>dialog1
End>Cancel
SRT>Tester
let>r<1>c:\audacitytestfile.mp3
Run Program>c:\Program Files\Audacity\Audacity.exe
wait>2
Send Character/Text>r
wait>1
Send Character/Text>s
wait>1
END>TESTER
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Three possible solutions:
1. Use a different variable name for the result of GetDialogAction.
2. Create a variable set to literal value "r" where you want to send it:
Let>TextToSend={"r"}
Send Character/Text>TextToSend
3. This is the best approach: Use VAREXPLICIT=1. Setting VAREXPLICIT to 1 means that when using variables you must refer to them in % symbols. Without % symbols they are literals. So your script would be:
1. Use a different variable name for the result of GetDialogAction.
2. Create a variable set to literal value "r" where you want to send it:
Let>TextToSend={"r"}
Send Character/Text>TextToSend
3. This is the best approach: Use VAREXPLICIT=1. Setting VAREXPLICIT to 1 means that when using variables you must refer to them in % symbols. Without % symbols they are literals. So your script would be:
Code: Select all
Let>VAREXPLICIT=1
Dialog>dialog1
Caption=TESTER
Width=445
Height=119
Top=522
Left=798
Max=0
Min=0
Close=1
Resize=1
Label=This is an automated error checker to test programs.,88,8,true
Label=Created for ESL Department by "MY NAME",104,24,true
Button=Test,136,48,75,25,1
Button=Exit,216,48,75,25,2
EndDialog>dialog1
Show>dialog1
label>actionloop
GetdialogAction>dialog1,r
if>%r%=2,Cancel
if>%r%=1,Tester
Goto>actionloop
Label>exit
SRT>Cancel
Closedialog>dialog1
End>Cancel
SRT>Tester
Run Program>c:\Program Files\Audacity\Audacity.exe
wait>2
Send Character/Text>r
wait>1
Send Character/Text>s
wait>1
END>TESTER
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
OK now i am testing windows media player. What i dont know is, are the type of error that can be generated by windows media player runnning a wma format file. If the file runs smoothly there should be no errors or in other words no windows should be popup. What commad should I use that if a new window popups up then error if not then no error someting like that...this is my apporach.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
For this I would use OnEvent with the WINDOW_NEWACTIVE paramater. This will call a subroutine whenever the foreground window changes.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?