Newest Spotify update: Autohotkeys script broke

我只是一个虾纸丫 提交于 2019-12-23 10:39:34

问题


I used to use the AutoHotKey script for Spotify shortcuts (the built in shortcuts are limited and only work if the app is in focus, I usually keep it in the background at work).

Anyway, it's updated a million times before with no problem.. but I downloaded the latest spotify update and it no longer works. Any idea why?

Here's the script.

#z::Run www.autohotkey.com

SetTitleMatchMode 2 

; "CTRL + LEFT"  for previous 
^Left:: 
{
DetectHiddenWindows, On 
ControlSend, ahk_parent, ^{Left}, ahk_class SpotifyMainWindow
DetectHiddenWindows, Off 
return 
}


; "CTRL + RIGHT"  for next 
^Right:: 
{ 
DetectHiddenWindows, On 
ControlSend, ahk_parent, ^{Right}, ahk_class SpotifyMainWindow 
DetectHiddenWindows, Off 
return 
} 

; "CTRL + UP"  for pause
^UP::
{ 
DetectHiddenWindows, On 
ControlSend, ahk_parent, {space}, ahk_class SpotifyMainWindow 
DetectHiddenWindows, Off 
return 
} 

; "CTRL + DOWN"  for info 
^Down:: 
{ 
DetectHiddenWindows, On 
SetTitleMatchMode 2 
WinGetTitle, now_playing, ahk_class SpotifyMainWindow 
StringTrimLeft, playing, now_playing, 10 
DetectHiddenWindows, Off 
clipboard = %playing%`r`n
return 
} 

; "CTRL + PAGE UP"  for volume up
^PgUP::
{ 
DetectHiddenWindows, On 
ControlSend, ahk_parent, ^{Up}, ahk_class SpotifyMainWindow 
DetectHiddenWindows, Off 
return 
} 

; "CTRL + PAGE DOWN"  for volume down
^PgDn::
{ 
DetectHiddenWindows, On 
ControlSend, ahk_parent, ^{Down}, ahk_class SpotifyMainWindow 
DetectHiddenWindows, Off 
return 
} 

; "CTRL + END"  for mute
^End::
{ 
DetectHiddenWindows, On 
ControlSend, ahk_parent, ^+{Down}, ahk_class SpotifyMainWindow 
DetectHiddenWindows, Off 
return 
}

回答1:


See this question: Hotkey for next song in Spotify - includes a statement from a Spotify developer, as well as a statement that it will be fixed in the upcoming version, as well as a workaround for the moment:

^Left::Media_Prev


来源:https://stackoverflow.com/questions/29040543/newest-spotify-update-autohotkeys-script-broke

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!