Jump to content

Simultaneously clicking a button on multiple applications?


Recommended Posts

Hey everyone, run into a bit of a jam here.

Let's say i have 10 identical applications open, and i need to simultaneously hit a button (Lets say "Go") on all of them, at the same time.

Is there any reliable way to do this that wont cause massive error's or anything like that?

Link to comment
Share on other sites

ControlClick might work.

Yes, it "worked" but only clicked on one of the applications (Even though all the controls are identical)

John,

That's fine too, as long as its done in very rapid succession, doesn't have to be *right* at the same time, split-seconds apart works for me too.

I have four of the applications open,

I run this code

ControlClick("[CLASS:WindowsForms10.window.8.app.0.378734a]", "", "WindowsForms10.BUTTON.app.0.378734a6","left",1)

But it only clicks on the last active application.

Edited by phatzilla
Link to comment
Share on other sites

  • Moderators

Not sure where you logic is calling controlclick one time and expect it to take action on everything.

Anyway, you'll need to get the handle of each individual application window ( hope that class is unique to just that apps window ).

Something like ( pseudo code ):

Global $ga_wlist = WinList("[CLASS:WindowsForms10.window.8.app.0.378734a]")
If Not IsArray($ga_wlist) Then Exit 1

For $i = 1 To $ga_wlist[0][0]
    ControlClick($ga_wlist[$i][1], "", "WindowsForms10.BUTTON.app.0.378734a6","left")
Next

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Thanks smoke, that seemed to have worked.

Couple questions / concerns though

- It seems as if they window has to be visible in order for the click to work? Weird.

- Sometimes the clicks dont seem to go through, even though all the windows are stored correctly in the array, no idea why this happens....

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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