I imagine it like this:
I launch Opera, I press the hotkey (F1) and the script should be doing what it's supposed to do to THAT PID, and then I open a new instance of Opera, and I press F1 once again and it does the same to that other PID. So, if I want the script to be paused, I need to be at the window itself, so that I can decide where and when to pause the script without pausing other PID's, if you know what I mean.
My script:
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#MaxThreadsPerHotkey 2
Settimer pressCevery7seconds, % 100 * 1000
Settimer pressReloadevery101minutes, % 500 * 1000
banana:=0
SetTitleMatchMode, 2
F1::
banana:=!banana
while (banana=1)
{
ControlClick, X121 Y321, ahk_class ahk_class Chrome_WidgetWin_1
SetControlDelay -1
Controlsend,, {1}, ahk_class ahk_class Chrome_WidgetWin_1
}
return
pressCevery7seconds:
SetControlDelay 0
ControlClick, X576 Y156, ahk_class ahk_class Chrome_WidgetWin_1
return
pressReloadevery101minutes:
ControlClick, X148 Y1, ahk_class ahk_class Chrome_WidgetWin_1
return
f7::ExitApp
Could someone help me please?