Spotify commands when song is playing
-
I've had no problem creating a script to open spotify and start a particular playlist. What I can't seem to figure out is how to control spotify ONCE A SONG IS ALREADY PLAYING. For example, the script below will increase the volume no problem when a song is not playing in spotify. But if something is playing, it's completely unresponsive. Essentially, any SendKeys commands are just ignored when Spotify is playing a song. Anyone solve this issue? Thanks in advance!
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.AppActivate "spotify"
WshShell.SendKeys "^{UP}" -
@dougcolt, I don't know. I'll have to try it myself, but initially I'm thinking it might take a second for Windows to make "spotify" the current application (I assume that's what WshShell.AppActivate does. So you might need a delay between that command and the up arrow.
-
Strange, I've read a lot about it on [reddit] and even came across it here, but I've never encountered it before.
-
With AutoHotkey you can try to trigger your Spotify Web? Desktop? client using ACC...
https://www.autohotkey.com/boards/viewtopic.php?f=6&t=26201&hilit=acc.ahkor UIAutomation...
https://www.autohotkey.com/boards/viewtopic.php?f=6&t=104999or COM (quite similar to what you've done already but triggering the elements directly instead of a generic ^{Up}), or...
Nah, don't do that.
I've used ACC to skip songs from an already executed playlist within a Spotify browser session once they are "blacklisted".
Your command would like like this...
"<path to>\AutoHotkey.exe" "<path to>\myScript.ahk" "1stParam" "2ndParam" "nthParam"HTH
BTW, for a more reliable approach, you can restrict sending "hotkeys" to specific (non-/active) windows.
-
i had the same problem
-
@Sadiethompson, can you be more specific? What problem?