Send Keystrokes to Specific Chrome Window - Audible Cloud Player

Get help with using AutoHotkey and its commands and hotkeys
User avatar
Bragato
Posts: 13
Joined: 28 Jun 2017, 07:38

Send Keystrokes to Specific Chrome Window - Audible Cloud Player

14 Jan 2019, 08:38

I want to assign the media keys on my keyboard to send keystrokes to a specific chrome window to controle the Audible Cloud Player.
The key reassign I can do easily, the problem is sending the keystrokes to that specific chrome window only.

The window looks like this: https://imgur.com/o33wVCs

So far I got this:

Code: Select all

SetTitleMatchMode, 3
DetectHiddenWindows, On

Media_Next::
ControlSend, ahk_parent, {right}, Cloud Player | Audible.com - Google Chrome
return

Media_Prev::
ControlSend, ahk_parent, {left}, Cloud Player | Audible.com - Google Chrome
return

Media_Play_Pause::
ControlSend, ahk_parent, {space}, Cloud Player | Audible.com - Google Chrome
return
But it works only if I'm with the window opened and focused on it, if it's on the background it doesn't work.

How can I do it?
User avatar
Bragato
Posts: 13
Joined: 28 Jun 2017, 07:38

Re: Send Keystrokes to Specific Chrome Window - Audible Cloud Player

14 Jan 2019, 08:45

I got it to work:

Code: Select all

SetTitleMatchMode, 3
DetectHiddenWindows, On

Media_Next::
WinGetTitle, CurrentWindow, A
WinActivate, Cloud Player | Audible.com - Google Chrome
ControlSend, ahk_parent, {right}, Cloud Player | Audible.com - Google Chrome
WinMinimize, Cloud Player | Audible.com - Google Chrome
WinActivate, %CurrentWindow%
return

Media_Prev::
WinGetTitle, CurrentWindow, A
WinActivate, Cloud Player | Audible.com - Google Chrome
ControlSend, ahk_parent, {left}, Cloud Player | Audible.com - Google Chrome
WinMinimize, Cloud Player | Audible.com - Google Chrome
WinActivate, %CurrentWindow%
return

Media_Play_Pause::
WinGetTitle, CurrentWindow, A
WinActivate, Cloud Player | Audible.com - Google Chrome
ControlSend, ahk_parent, {space}, Cloud Player | Audible.com - Google Chrome
WinMinimize, Cloud Player | Audible.com - Google Chrome
WinActivate, %CurrentWindow%
return
But it activates and deactivates the window, it works exactle like I want to but I think there's a way to do it without activating and minimazing it...

Return to “Ask For Help”

Who is online

Users browsing this forum: Albireo, Bing [Bot], rogersonra, SBS, teadrinker, tomytexd and 130 guests