Skip to content

Instantly share code, notes, and snippets.

View doubleday's full-sized avatar

Daniel Doubleday doubleday

View GitHub Profile
@doubleday
doubleday / When Song Finishes, Pause.applescript
Created May 17, 2022 21:28 — forked from capnslipp/When Song Finishes, Pause.applescript
Pause Spotify after the current song finishes playing
(*
@author: Slipp Douglas Thompson
@purpose: Pauses Spotify after the current song finishes playing.
@todo: Optimize so it's more efficient.
@usage: Drop a compiled script (a .scpt file, converted with AppleScript Editor if this is a .applescript file) into ~/Library/Scripts/Applications/Spotify.
Ensure than “Show Script menu in menu bar” is enabled (which can be found in the AppleScript Editor preferences).
When playing a song in Spotify and wishing to stop the music when the track finished, choose “When Song Finishes, Pause” from the script menu, and then walk, walk away.
*)
tell application "Spotify"
log "“When Song Finishes, Pause”: player state is " & (player state)