Advertisement
Guest User

Untitled

a guest
Feb 9th, 2018
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SetTitleMatchMode 2
  2.  
  3. #Persistent
  4.  
  5. ; "CTRL + LEFT" for previous
  6. ^Left::Media_Prev
  7.  
  8. ; "CTRL + RIGHT" for next
  9. ^Right::Media_Next
  10.  
  11. ; "CTRL + DOWN" for pause
  12. ^Down::Media_Play_Pause
  13.  
  14. ; "CTRL + UP"  for info
  15. ^Up::
  16. {
  17. DetectHiddenWindows, On
  18. SetTitleMatchMode 2
  19. WinGetTitle, playing, ahk_class SpotifyMainWindow
  20. if(playing <> "" or playing != "Spotify") {
  21. ;Save to Log
  22. numlines := 0 ; Because we add the next entry
  23.  
  24. Loop, Read, %UserProfile%\Desktop\SavedMusicLog.txt
  25. {
  26.    If (A_LoopReadLine != "")
  27.    
  28.    numlines++
  29. }
  30. ;MsgBox, Total number of lines in the file "%UserProfile%\Desktop\SavedMusicLog.txt" :%numlines%
  31. FileAppend, %numlines%. %playing%`n, %UserProfile%\Desktop\SavedMusicLog.txt
  32. Clipboard = %playing%
  33. Send {Media_Play_Pause down}{Media_Play_Pause up}
  34. Send {Media_Play_Pause down}{Media_Play_Pause up}
  35. }
  36. DetectHiddenWindows, Off
  37. return
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement