Jump to content

Changing songs using shortcuts


 Share

Recommended Posts

Hello guys

I would like to be able to change songs on spotify using shourtcuts on my keyboard due to the fact i don't own a keyboard with extra keys providing this feature.

Therefor I've made a script binding my keys to make this possible, but i have a few issues and I think there is a easier or better way of creating this script. I hope someone can have a look and tell me what i could improve.

Some of the issues are:

  • I have to wait a little time before i will be able to change song right after i just changed. (I can't spam ALT + Right)
  • Doesn't work when im inside a game. This is actually a big issue for me.

 

My current code which works:

HotKeySet("!{left}", "Previous")
HotKeySet("!{right}","naeste")
HotKeySet("!{down}","current")
HotKeySet("{DEL}","quit")


While 1
    Sleep(100)
WEnd

Func naeste()
   Sleep(400)
   ControlSend("Spotify", "", "", "^{right}")
EndFunc

Func Previous()
   Sleep(400)
   ControlSend("Spotify", "", "", "^{left}")
EndFunc

Func Current()
   Local $song = WinGetTitle("Spotify", "")
   TrayTip("", $song, 1)
EndFunc

Func quit()
   Exit 0
EndFunc

- AliOzturk

Edited by AliOzturk
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...