Jump to content

Recommended Posts

Posted (edited)

I have been trying to write a script which clicks on button a if it exists or button b if button a and b exist.

Without success.

Both buttons have the same class, so I searched for a method to determine whether or not a specific instance of a class exists in a window. Doesn't seem to be the case.

WinGetClassList() didn't help since there it doesn't return instance information.

How would one check for a class instance to exist ?

Edited by level20peon
Posted (edited)

I created a workaround by checking for the instance text with ControlGetText() which I use to compare the output strings.

I still am interested if there is a more elegant way to check for the existence of class instances though.

EDIT: you replied when I composed this post. I will see if I find additional information here.

EDIT2: I didn't find a way to check for an instances existence using the "Window Titles and Text (Advanced)" information.

I tried something like this

WinWaitActive("[TITLE:WindowTitle; CLASS:ClassXYZ; INSTANCE:1]", "")

Subsequently an "if WinExists(...)" doesn't throw results either.

Any idea what I'm doing wrong here ?

Edited by level20peon

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...