Hi all,
I've just discovered this great software, but here I need some help. I want a make a script like that : if the title of active window contains expression1 or expression2 or expression3, the script launches a program
This one doesn't work :
WaitWindowOpen>{("first title") or ("second title") or ("third title")}
RunProgram>C:\program.exe
Thanks
Make thing based on window title
Moderators: Dorian (MJT support), JRL
Code: Select all
//sets the active window name to variable "title"
GetActiveWindow>title,WinX,WinY
//Since we will be matching text no need to struggle with text case
//therefore set case of variable value to lower case.
LowerCase>title,title
//Use separate to determine if the text "expression1" is to be
//found within the value of variable "title".
Separate>title,expression1,res1
//If "expression1" text was found, run a program
If>res1_count>1
Run>Program1.exe
EndIf
//same as above
Separate>title,expression2,res2
If>res2_count>1
Run>Program2.exe
EndIf
//same as above
Separate>title,expression3,res3
If>res3_count>1
Run>Program3.exe
EndIf
Not exactly what I'm looking for, I explain better what the script should do :
- When the script is launched, it never stops
- it keeps monitoring active windows titles
- whenever an active window title is "title 1" or "title 2" or "title 3", send this combination of keys : CTRL ALT a
- during 3 minutes, if that active window is being inactive then active or another window with correct title is active, do not send CTRL ALT a again.
- after 3 minutes, send this combination of keys : CTRL ALT b
- Script still continue to be on, doing its job
- When the script is launched, it never stops
- it keeps monitoring active windows titles
- whenever an active window title is "title 1" or "title 2" or "title 3", send this combination of keys : CTRL ALT a
- during 3 minutes, if that active window is being inactive then active or another window with correct title is active, do not send CTRL ALT a again.
- after 3 minutes, send this combination of keys : CTRL ALT b
- Script still continue to be on, doing its job
Last edited by Okapi on Wed Dec 29, 2010 3:20 pm, edited 1 time in total.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Something like:
Code: Select all
Label>start
GetActiveWindow>title,x,y
If>{(%title%="title 1") OR (%title%="title 2") OR (%title%="title 3")}
Press CTRL
Press ALT
Send>a
Release ALT
Release CTRL
Wait>180
Press CTRL
Press ALT
Send>b
Release ALT
Release CTRL
Endif
Wait>0.02
Goto>start
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?