I'm trying to restore a minimized firefox window, but nothing i'm trying seems to work.
My current code is as following and absolutely nothing happens when I run it!
I'm a noob at this so i appreaciate any and all help!
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.
;Attempting to Restore Minimized Firefox window.
;PID=18064
;class=MozillaWindowClass
;title=*Mozilla Firefox
f1::
hWindow = WinGet, hWindow, ID, Mozilla Firefox ;that should get active windows handle
return
f2::
;attempt to raise the window
WinActivate — *Mozilla Firefox ; Activate FF
;WinWaitActive — Mozilla Firefox ; Wait 'till is active
;attempt to raise the window by class
WinActivate, ahk_class MozillaWindowClass
;attempt to raise the window by ID
WinActivate, ahk_id %hWindow%
;attempt to raise the window by PID
WinActivate, ahk_pid 18064
;attempt to raise the window by title regex
SetTitleMatchMode, RegEx
WinActivate, .* - Mozilla Firefox ;window title must end in "- Mozilla Firefox"
ControlFocus, OK, "*Mozilla Firefox"
;change tabs
Send ^1 ; Activate tab #2 (ie Youtube)
;change tabs
ControlSend,, {Control Down}1{Control Up}, ahk_id %hWindow% ; sending directly to window handle ensures reliablity
return
f12::
ExitApp