After March 2015 upgrade of Spotify the below hotkey no longer works to get next song in Spotify:
; Spotify next track
<^>!p::
DetectHiddenWindows, On
ControlSend, ahk_parent, ^{Right}, ahk_class SpotifyMainWindow
DetectHiddenWindows, Off
Return
The SpotifyMainWindow" appears to be the same when checking with spy, and Ctrl-Right also still works for next song in Spotify, but the hotkey don't.
How to make a hotkey for next song in the upgraded Spotify?
I managed to make it work using multimedia keycodes. Here's my script:
; "CTRL + LEFT" for previous
^Left::Media_Prev
; "CTRL + RIGHT" for next
^Right::Media_Next
; "CTRL + SPACE" for pause
^Space::Media_Play_Pause
It's working like a charm now.
For Windows 8 Users, I modified the previous script to one that will work for your OS! Will change to Previous song, Pause/Play, Next song
; "CTRL + LEFT" for previous
^Left::Send {Media_Prev}
; "CTRL + RIGHT" for next
^Right::Send {Media_Next}
; "CTRL + SPACE" for pause
^Space::Media_Play_Pause
A work around in the mean time is to bring the Spotify window to the front, send it a space and then minimise it again.
You may want to stop it minimising according to your own preference
Re-edit - got it working for skipping tracks as well, it's a bit hacky and may not work if you have UAC enabled (according to the docs) , YMMV. Works for me though
ScrollLock::
{
DetectHiddenWindows, On
WinActivate, ahk_class SpotifyMainWindow
SendInput, , ^{Right}, ahk_class SpotifyMainWindow
Sleep, 100
ControlSend, , {Space}, ahk_class SpotifyMainWindow
DetectHiddenWindows, Off
WinMinimize, ahk_class SpotifyMainWindow
return
}
PrintScreen::
{
DetectHiddenWindows, On
WinActivate, ahk_class SpotifyMainWindow
SendInput, , ^{Left}, ahk_class SpotifyMainWindow
Sleep, 100
ControlSend, , {Space}, ahk_class SpotifyMainWindow
DetectHiddenWindows, Off
WinMinimize, ahk_class SpotifyMainWindow
return
}
Pause::
{
DetectHiddenWindows, On
WinActivate, ahk_class SpotifyMainWindow
ControlSend, , {Space}, ahk_class SpotifyMainWindow
DetectHiddenWindows, Off
WinMinimize, ahk_class SpotifyMainWindow
return
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With