Wildcards or RegEx in windows commands.

Ideas for new features & functions

Moderators: Dorian (MJT support), JRL

Post Reply
gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

Wildcards or RegEx in windows commands.

Post by gdyvig » Wed Apr 01, 2009 10:02 pm

I noticed that OnEvent and the windows functions treat the wildcard asterisk somewhat differently than peope may be accustomed to. The behavior is clearly documented if you read it closely.

In most systems a trailing asterisk means the starting characters must match up to the asterisk. But in Macro Scheduler a trailing asterisk means the characters are CONTAINED in the window title, though it looks for an exact match before looking for less likely candidates.

Could we have a system variable or some way of indicating we wish to more narrowly select the window name? And perhaps a way of indicating we wish to consider case.
Examples:
Let>WIN_WILDCARDS=1
Let>WIN_CASE=1
SetFocus,Win*Scripting*Automation*Recorder*
//The above will work for "Windows Scripting, Windows Macro Automation, Windows Macro Recorder - Automate your PC for Wind - Microsoft Internet Explorer p"
//The above will not work for "Macro Scheduler Windows Scripting, Automation, and Recorder program"
//The above will not work for "Windows scripting, macro automation, recorder - "


This would make it easier to prevent OnEvent>WINDOW_OPEN from triggering on unintended windows.
Example:
OnEvent>WINDOW_OPEN,Query*,2,DoQuery
//A query dialog titled "Query xxxx" may display at any time
SetFocus>Ambiguity Query System*
//Oops, our main window also triggers the OnEvent!

All of this can be worked around, but our scripts could be simpler when fewer workarounds are needed.

editted 4/2/09:
These would be equivalent:

//proposed
Let>WIN_WILDCARDS=1
Let>WIN_CASE=1
SetFocus>*Automation*

//legacy and default
Let>WIN_WILDCARDS=0
Let>WIN_CASE=0
SetFocus>Automation*


Any feedback?

Thanks,

Gale

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