Uclick with wildcard

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
portabletelly
Newbie
Posts: 6
Joined: Mon Sep 28, 2015 3:57 am

Uclick with wildcard

Post by portabletelly » Wed Sep 30, 2015 5:08 am

Hi All,

So I wrote a Macro that basically Teamviewers into a pc, reconsises whats on the screen and logs in.
Works fine on one machine but when I take this over to another machine the Teamviewer title varies by 1 character. Probley auto adjust by screen resolutoin.

So anyway to get around this issue can I use wildcards to do a part match on a windows name.

This is my Code on the machine it was coded on

Code: Select all

UIClick>{"Monkomo otel SBSbox MKH-SRV-01 - TeamViewer"},{"Ctrl+Alt+Del"}
This is the Code I need to use to work on the other mahcine

Code: Select all

UIClick>{"Monkomo hotel SBSbox MKH-SRV-01 - TeamViewer"},{"Ctrl+Alt+Del"}
My question is will something like this work. I am trying to use a wild card so its only checking the first part of name and what comes after doesnt matter.

Code: Select all

UIClick>{"Monkomo" + "*"},{"Ctrl+Alt+Del"}
Whats syntax would be required to achieve this?

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

Re: Uclick with wildcard

Post by Marcus Tettmar » Wed Sep 30, 2015 9:03 am

You need to do it like all of the other window functions:

UIClick>Monkomo*,{"Ctrl+Alt+Del"}
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

portabletelly
Newbie
Posts: 6
Joined: Mon Sep 28, 2015 3:57 am

Re: Uclick with wildcard

Post by portabletelly » Fri Oct 02, 2015 5:14 am

Can I use an or Syntax in this
EG.

Code: Select all

UIClick>Monkomo* OR Othertext*,{"Ctrl+Alt+Del"}

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

Re: Uclick with wildcard

Post by Marcus Tettmar » Fri Oct 02, 2015 10:43 am

You can use RegEx as with all other window functions. E.g.:

Let>WIN_REGEX=1
UIClick>.*Monkomo.*|.*Othertext.*,{"Ctrl+Alt+Del"}

See help file or online here:
https://www.mjtnet.com/manual/index.html?uiclick.htm
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