I have tested the below script without the IF command and the process works as I was hoping. Now I want to ensure that I do not open a duplicate window, however when debugging I get an error. "The 'true' label can not be found.
What am I missing or doing wrong? Any help would be greatly appreciated.
Rick
IfWindowOpen>CoverLetter - Microsoft Word,true
ExecuteFile>D:\My Documents\CoverLetter.doc
WaitWindowOpen>CoverLetter - Microsoft Word
Label>true
SetFocus>CoverLetter - Microsoft Word
Press CTRL
Send Character/Text>ac
Release CTRL
Run Program>notepad.exe
WaitWindowOpen>Untitled - Notepad
SetFocus>Untitled - Notepad
Press CTRL
Send Character/Text>V
Release CTRL
Why doesn't my IfWindowOpen command work?
Moderators: JRL, Dorian (MJT support)
Thank You!
You were right on the money... It seems that I had a space after the lable's name.
Thanks again for the swift reply.
Rick
Thanks again for the swift reply.
Rick
Similar issue
I am new to MS, but have a fairly good understanding of basic scripting (I think). No matter what I do, my IfWindowOpen statement always runs as if the statement was true. What am I doing wrong? Here's a snipit of code:
Press Enter
Wait>2.00
Let>WF_TYPE=2
IfWindowOpen>KCX\Manager,NoData
Label>Data
GoSub>PrintReport
GoSub>CloseReport
Goto>Return Report
Label>NoData
GoSub>NoDataWindow
Goto>Return Report
Label>Return Report
.
////Subroutines below////
.
SRT>CloseReport
Press CTRL
Wait>0.10
Press F4
Wait>0.10
Release CTRL
Wait>0.10
MouseMove>238,57
End>CloseReport
.
SRT>NoDataWindow
Wait>0.10
Press Enter
WaitWindowOpen>xStore Manager 2.72 - [Work With Reports]
MoveWindow>xStore Manager 2.72 - [Work With Reports],-4,-4
ResizeWindow>xStore Manager 2.72 - [Work With Reports],1032,748
Wait>0.10
End>NoDataWindow
.
SRT>PrintReport
MouseMove>350,224
LClick
Wait>10.00
MouseMove>220,27
LClick
MouseMove>233,72
Wait>2.00
LClick
Wait>5.00
End>PrintReport
I unfortunatly have to use mouse movements and clicks because the program doesn't support keyboard use in all situations.
Any ideas on what I've done wrong?
Press Enter
Wait>2.00
Let>WF_TYPE=2
IfWindowOpen>KCX\Manager,NoData
Label>Data
GoSub>PrintReport
GoSub>CloseReport
Goto>Return Report
Label>NoData
GoSub>NoDataWindow
Goto>Return Report
Label>Return Report
.
////Subroutines below////
.
SRT>CloseReport
Press CTRL
Wait>0.10
Press F4
Wait>0.10
Release CTRL
Wait>0.10
MouseMove>238,57
End>CloseReport
.
SRT>NoDataWindow
Wait>0.10
Press Enter
WaitWindowOpen>xStore Manager 2.72 - [Work With Reports]
MoveWindow>xStore Manager 2.72 - [Work With Reports],-4,-4
ResizeWindow>xStore Manager 2.72 - [Work With Reports],1032,748
Wait>0.10
End>NoDataWindow
.
SRT>PrintReport
MouseMove>350,224
LClick
Wait>10.00
MouseMove>220,27
LClick
MouseMove>233,72
Wait>2.00
LClick
Wait>5.00
End>PrintReport
I unfortunatly have to use mouse movements and clicks because the program doesn't support keyboard use in all situations.
Any ideas on what I've done wrong?
There is nothing wrong with your script so if it resolves true then there *IS* a window present on the system at that time matching that string. Has to be. What do you see in Tools/View System Windows?
MJT Net Support
[email protected]
[email protected]
Armsys - the spaces were added when you copied the code from the forum, I can see that the original script had no spaces.
MJT Net Support
[email protected]
[email protected]
That was it. It turns out that whenever the parent application is running there is a hidden window with that name. I turned my script around so that it looked for the other window (when there is data in the report) and it takes the appropriate action. Here is a snipit of the changed and correct code:support wrote:There is nothing wrong with your script so if it resolves true then there *IS* a window present on the system at that time matching that string. Has to be. What do you see in Tools/View System Windows?
Press Enter
Wait>2.00
Let>WF_TYPE=2
IfWindowOpen>xStore Manager 2.72 - [Form1],DefData,DefNoData
Label>DefData
GoSub>PrintReport
GoSub>CloseReport
Goto>Return Report
Label>DefNoData
GoSub>NoDataWindow
Goto>Return Report
Label>Return Report
Thanks again for the help.
