2 objects with same name

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
mcossari
Newbie
Posts: 3
Joined: Thu May 15, 2014 5:03 pm
Location: Brazil

2 objects with same name

Post by mcossari » Sun Nov 16, 2014 1:37 pm

Hi

I am using UIClick to interact with a object, but there are 2 objects with same name in the screen.

MS Command:

Code: Select all

UIClick>{"::.. Simulador de Alçadas  ..::  --  Versão : 1.0.0.17 --  File Version : 1.0.0.17"},{"Home"}
One of them is a "MenuItem", the other is a "Label", is it possible to handle this issue?

Thanks in advance.

Marcio

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

Re: 2 objects with same name

Post by Marcus Tettmar » Mon Nov 17, 2014 9:21 am

This is the problem with apps that have not been made fully "accessible" and we don't end up with unique identifiers. Windows is left to name things based on labels.

What you can do is use UIGetValue instead. This will return a list of the items and their positions. So you should get a list of the two matching items and a list of positions. You can figure out if the one you want is the first or second. Use Separate to get the items out and then use the positions to move the mouse and click.

So something like:

Code: Select all

UIGetValue>{"::.. Simulador de Alçadas  ..::  --  Versão : 1.0.0.17 --  File Version : 1.0.0.17"},{"Home"},theVals,thePositions

//let's say you want the second one ... 
Separate>thePositions,|,parts
Separate>parts_2,pos
Separate>pos,COMMA,xys
MouseMove>xys_1,xys_2
LClick
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

mcossari
Newbie
Posts: 3
Joined: Thu May 15, 2014 5:03 pm
Location: Brazil

Re: 2 objects with same name

Post by mcossari » Mon Nov 17, 2014 2:51 pm

Thank you for your reply.
But I will facing this problem because I defined this command on beginning:

Code: Select all

Let>VAREXPLICIT=1
I handled this issue.

Thanks.

- Marcio

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