cassetti Posted February 5, 2013 Share Posted February 5, 2013 Hey All!I'm a huge Last.FM fan (though Pandora is becoming a competitor now). I've been using last.fm for over 7 years. At work I love to stream Last.FM to my computer the whole day using the Last.FM windows scrobbler app. However the previous versions stunk! No matter how hard I tried with AutoIt, I could never find a way to play/pause the music and skip tracks using my windows keyboard media controls (winactivate never worked properly) - seriously spent hours trying various methods short of mouse coordinates. However, Last.FM recently updated their app to version 2.1 which is a new interface (with several handy keyboard shortcuts)So if you are running Windows Scrobbler version 2.1 or newer, this code should work. I created two scripts for my needs - play/pause, and skip track (both using keyboard shortcuts). After compiling, I assigned the programs to the keypress. However if you cannot do that with your keyboard software, you may be able to use a hotkeyset and use a while loop to run indefinately in the background.....Play/Pause Script; Grab current active window $title = WinGetTitle("[active]") ;Select Last.fm Window Opt("WinTitleMatchMode", 2) WinActivate("Last.fm Scrobbler") Sleep(100) ;just for giggles sake I always use a short pause ;Send Pause Command Send("{space}") ;Activate previous window WinActivate($title)Skip Track Script; Grab current active window $title = WinGetTitle("[active]") ;Select Last.fm Window Opt("WinTitleMatchMode", 2) WinActivate("Last.fm Scrobbler") Sleep(100) ;just for giggles sake I always use a short pause ;Send Next Track Command Send("^{right}") ;Activate previous window WinActivate($title) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now