IfWindowOpen not calling SRT properly

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
NewScriptee
Newbie
Posts: 11
Joined: Sun Mar 06, 2011 11:06 pm

IfWindowOpen not calling SRT properly

Post by NewScriptee » Mon Mar 14, 2011 12:28 am

I have gotten the hang of pretty much everything i need so far, but one thing that seems to not work is the IfWindowopen...the true part does but the false seems to fail...

I am running this code but if for some reason Chrome is closed out, it doesn't open chrome first it just goes to the calculator command then opens chrome even though it is not first in the macro script. am I missing something here?


// Recorded on Sunday, March 13, 2011, at 01:01 PM
//Set IGNORESPACES to 1 to force script interpreter to ignore spaces.
//If using IGNORESPACES quote strings in {" ... "}
//Let>IGNORESPACES=1
//LOOP Enable Feature
Let>WW_TIMEOUT=5
Let>Repeat=0
Label>Repeat_Loop
Wait>1
Add>Repeat,1
//CHANGE BELOW**********************************************************************
IF>Repeat=775,Done_Repeating
//CHANGE ABOVE**********************************************************************
//SUBROUTINES
//Restart

SRT>chromerestore
Let>WIN_USEHANDLE=0
Let>WF_TYPE=1
WaitWindowOpen>Google Chrome
SetFocus>Google Chrome
Press Enter
WaitWindowOpen>New Tab - Google Chrome
SetFocus>New Tab - Google Chrome
Wait>2
Mousemove>662,493
LClick
END>chromerestore
//Reset

SRT>resetpush
WaitWindowOpen>We were unable to process your request in time - Blogspot - Google Chrome
SetFocus>We were unable to process your request in time - Blogspot - Google Chrome
MouseMove>74,472
LClick
Wait>5
END>resetpush
//Open

SRT>chromeopen
//ChangeBelow***********************************************************************
//Recorded Events
Let>WW_TIMEOUT=5
CapsOff
MouseMove>106,18
Wait>4.15
LClick
Wait>0.11
MouseMove>110,30
Wait>0.98
LDblClick
WaitWindowOpen>New Tab - Google Chrome
MoveWindow>New Tab - Google Chrome,-4,402
ResizeWindow>New Tab - Google Chrome,1400,602
Wait>0.01
MouseMove>680,498
Wait>5.29
LClick
WaitWindowOpen>Messages on Blogspot - Google Chrome
MoveWindow>Messages on Blogspot - Google Chrome,-4,402
ResizeWindow>Messages on Blogspot - Google Chrome,1400,602
Wait>5.55
//ChangeAbove***********************************************************************
END>chromeopen

//Main Script ***
//Recorded Events
CapsOff
Wait>3
Label>start
Let>WIN_USEHANDLE=0
Let>WF_TYPE=1
Let>WW_TIMEOUT=5
IfWindowOpen>Messages on Blogspot - Google Chrome,one,chromeopen
Wait>5
Label>one
MouseMove>28,98
Wait>1.89
LDown
WaitWindowOpen>Calculator
MoveWindow>Calculator,-111,86
ResizeWindow>Calculator,218,308
Wait>0.14
LUp
Wait>1.01
Press NP Add
Wait>0.41
Press NP1
Wait>0.34
Press Enter
Wait>1.03
Press CTRL
Wait>0.34
Send>c
Wait>0.22
Release CTRL
Wait>0.42
MouseMove>436,461
WaitWindowOpen>Messages on Blogspot - Google Chrome
MoveWindow>Messages on Blogspot - Google Chrome,-4,402
ResizeWindow>Messages on Blogspot - Google Chrome,1400,602
Wait>0.19
LClick
Wait>1.4
Press Backspace
Wait>0.42
Send>http://Blogspot.com/messages/new?to=
Wait>0.7
Press CTRL
Wait>0.17
Send>v
Wait>0.22
Release CTRL
Wait>2.64
Send>
Wait>1.16
Press Enter
Wait>0.05
MouseMove>401,101
Wait>8.13
LDown
WaitWindowOpen>C
//ChangeBelow*****************************************************************************************
MoveWindow>C,\Users\Sound25\Desktop\blogged.htm - Windows Internet Explorer,619
//ChangeAbove*****************************************************************************************
ResizeWindow>C,110,-619
Wait>0.23
LUp
Wait>1.06
Press CTRL
Wait>0.28
Send>a
Wait>0.16
Release CTRL
Wait>0.39
Press CTRL
Wait>0.2
Send>c
Wait>0.2
Release CTRL
Wait>0.56
MouseMove>408,418
Label>second
WaitWindowOpen>New Message on Blogspot - Google Chrome
MoveWindow>New Message on Blogspot - Google Chrome,-4,402
ResizeWindow>New Message on Blogspot - Google Chrome,1400,602
Wait>0.33
LClick
Wait>1.55
//ChangeBelow*******************************************************************************************
Send>In response to your request
//ChangeAbove*******************************************************************************************
Wait>1.97
Press Tab
Wait>1.84
Press CTRL
Wait>0.28
Send>v
Wait>0.2
Release CTRL
Wait>2.88
Press Tab
Wait>2.31
Press Enter
Wait>120
//Closes the loop function
Label>finalpart
Goto>Repeat_Loop
Label>Done_Repeating
MDL>Operation Completed Sucessfully

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Mar 14, 2011 9:20 am

I would change your IfWindowOpen line to:

Code: Select all

IfWindowOpen>Messages on Blogspot - Google Chrome
  Goto>one
Else 
  SRT>chromeopen
Endif
However I'm not clear on whether you still want to execute the statements after label one, as currently even if the above yields false and runs chromeopen the rest (everything including and after Label>one) will still be executed.

In fact since Label>one is immediately after the IfWindowOpen check you do not need the Goto>one line.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts