Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SetTitleMatchMode 2
- #Persistent
- ; "CTRL + LEFT" for previous
- ^Left::Media_Prev
- ; "CTRL + RIGHT" for next
- ^Right::Media_Next
- ; "CTRL + DOWN" for pause
- ^Down::Media_Play_Pause
- ; "CTRL + UP" for info
- ^Up::
- {
- DetectHiddenWindows, On
- SetTitleMatchMode 2
- WinGetTitle, playing, ahk_class SpotifyMainWindow
- if(playing <> "" or playing != "Spotify") {
- ;Save to Log
- numlines := 0 ; Because we add the next entry
- Loop, Read, %UserProfile%\Desktop\SavedMusicLog.txt
- {
- If (A_LoopReadLine != "")
- numlines++
- }
- ;MsgBox, Total number of lines in the file "%UserProfile%\Desktop\SavedMusicLog.txt" :%numlines%
- FileAppend, %numlines%. %playing%`n, %UserProfile%\Desktop\SavedMusicLog.txt
- Clipboard = %playing%
- Send {Media_Play_Pause down}{Media_Play_Pause up}
- Send {Media_Play_Pause down}{Media_Play_Pause up}
- }
- DetectHiddenWindows, Off
- return
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement