Hi,
I tried to use WaitWindowOpen> with an argument as *name. i.e. I know the last part of the name instead of what it begins with. That did not work. Is there a trick to wait for a window when I do not know what will it begin with?
Thanks,
Raymond
WaitWindowOpen/Close if I know last part of the name
Moderators: JRL, Dorian (MJT support)
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Use:
WaitWindowOpen>name*
WaitWindowOpen>name*
If the last character of the window title specified is an asterisk (*), Macro Scheduler will attempt to setfocus to the first window whose title matches the text entered exactly. If it cannot make an exact match it then looks at all windows and sets focus to the first one it finds whose title contains the entered text. This solves the problem with applications such as Word or Netscape which change their titles depending on the document loaded. It is best to try to provide an exact (including case) window title to ensure the correct window is found, as many applications have multiple invisible windows with similar names. Specifying text without a trailing asterisk will force Macro Scheduler to only look for an exact match.
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?
Hi rsamour,
The Macro Scheduler trailing wildcard actually means "contains", not "starts with" as you might suppose.
Let's say exact window title is "The name of the game"
The following statements will wait for the above window:
WaitWindowOpen>The name of the game
WaitWindowOpen>The name*
WaitWindowOpen>name*
WaitWindowOpen>game*
Where you can have a problem with this wildcarding scheme is when there are other open windows with similar names, like:
"The game is name"
"The name game"
"My name is Sue, how do you do?"
Do a search on wildcards and you will find some further discussion on this issue.
Gale
The Macro Scheduler trailing wildcard actually means "contains", not "starts with" as you might suppose.
Let's say exact window title is "The name of the game"
The following statements will wait for the above window:
WaitWindowOpen>The name of the game
WaitWindowOpen>The name*
WaitWindowOpen>name*
WaitWindowOpen>game*
Where you can have a problem with this wildcarding scheme is when there are other open windows with similar names, like:
"The game is name"
"The name game"
"My name is Sue, how do you do?"
Do a search on wildcards and you will find some further discussion on this issue.
Gale
Thank you Gale. I actually tried your suggestion before as I suspected that it is what Marcus had meant and it did not work. I waiting for an IE to open by specifying "Windows*", Windows Internet*" and "Windows Internet Explorer*" and all did not work. After receiving your reply I waited by specifying "- Windows*", it worked. No idea why but it works.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
No, I read your question carefully. I could accuse you of what you accused me and say that you read the documentation too quickly. But that might be considered rude. Instead I'll paste the documentation below again and this time I'll emphasise the key words:rsamour wrote:Hi Marcus, I gather your read my question rather quickly. What I know is that the title will be "*name" and NOT "name*" i.e. the first part of it is a variable and the second part is a fixed name.
Is there a way of waiting for a *name window?
It means "contains the proceeding text".If the last character of the window title specified is an asterisk (*), Macro Scheduler will attempt to setfocus to the first window whose title matches the text entered exactly. If it cannot make an exact match it then looks at all windows and sets focus to the first one it finds whose title contains the entered text. This solves the problem with applications such as Word or Netscape which change their titles depending on the document loaded. It is best to try to provide an exact (including case) window title to ensure the correct window is found, as many applications have multiple invisible windows with similar names. Specifying text without a trailing asterisk will force Macro Scheduler to only look for an exact match.
If it "does not work" and does not say that no window was found then that means it found some other window. There are bound to be dozens of windows, hidden or otherwise, on your system with the word "windows" in it and certain more than one with "windows internet" in the title. Narrow down your search and/or use the WF_TYPE flags (use the one that is for visible windows only). The visible IE container window you are wanting to find has "- Windows Internet Explorer" in the title, with the first part being the title of the active page. This is unique compared to the other "windows internet" windows. Look in Tools/View System Windows to see what I mean. Hopefully that explains why your first attempt failed. But perhaps I have read your email too quickly and failed to explain myself again.

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?