Totto Bennington
Totto Bennington

Reputation: 23

How to click in two different programs at the same time?

I want to be able to start a timer at the same time that i start a video in media player classic & also be able to pause both at the same time.

lets say that i have to click in the timer the one tha tis in the top left of the image and then click f1 or else the script does not work... also if i want to click it again after the first time it does not work properly..

IMAGE with the idea of what i want to do

I tried the following code:

F1::
MouseClick, left, 146, 115
MouseClick, left, 87, 300
Return

Upvotes: 2

Views: 1829

Answers (2)

fisknils
fisknils

Reputation: 66

I suppose that adding

CoordMode, Mouse, Screen

at the top of your script will help you achieve what you're looking to do.

However, I suggest you use ControlClick instead.

F1::
    ControlClick, x87 y300, Hourglass,, Left
    ControlClick, x100 y100, Media Player Classic,, Left
return

This will send a click to the x and y relative to each window regardless if they're on top or not (they cannot, however, be minimized)

(please note that you probably have to adjust the x and y coordinates)

https://autohotkey.com/docs/commands/CoordMode.htm https://autohotkey.com/docs/commands/ControlClick.htm

Upvotes: 0

Daniel Gregory
Daniel Gregory

Reputation: 31

From my (limited) experience, I believe even hotkeys will carry out actions sequentially i.e. one after the other, in most cases the time delay between clicks will be insignificant howeverwon't be exact. If the timer (Hourglass) is something you have created yourself, I would maybe suggest adding another button or a hotkey specifically for this use case that adds; for example, a 0.5s delay before the timer begins & then starts the media 0.5s later allowing for them to work in tandem, but as far as starting both applications simultaneously I'm not aware of a method for this.

To clarify though, what was the actual issue with the quoted code above?

Upvotes: 1

Related Questions