Regex-based SetFocus Extremely Slow

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Regex-based SetFocus Extremely Slow

Post by armsys » Mon Jun 19, 2017 1:21 am

With the recent versions of MS, I notice a significant delay in SETFOUCS with WIN_REGEX=1.
For example,

Code: Select all

Let>WIN_REGEX=1
Let>Pgm={"^EditPad Pro 7 -"}

Code: Select all

Let>WIN_REGEX=0
Let>Pgm=EditPad Pro 7 -*
The speed of SetFocus resulted from the above 2 approaches is significant different.
Is there a way to speed up regex-based SetFocus?
Thank you.

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

Re: Regex-based SetFocus Extremely Slow

Post by Marcus Tettmar » Mon Jun 19, 2017 2:17 pm

I don't think this is surprising - it has to perform the regex comparison against all open windows on the system. Clearly there is going to be a performance hit.
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
cron
Sign up to our newsletter for free automation tips, tricks & discounts