Skip to content

Instantly share code, notes, and snippets.

@iolloyd
Created February 13, 2013 18:51
Show Gist options
  • Save iolloyd/4947078 to your computer and use it in GitHub Desktop.
Save iolloyd/4947078 to your computer and use it in GitHub Desktop.
update to spotify to audio hijack pro script
(* Script to record and tag spotify tracks, by Lloyd Moore *)
tell application "Spotify"
set currentTrack to (current track)
set trackName to (name of currentTrack)
tell application "Audio Hijack Pro"
set theSession to my getSession()
end tell
repeat
if trackName is not equal to (name of currentTrack) then
set trackName to name of current track
set trackArtist to artist of current track
set trackAlbum to album of current track
my recordTrack(theSession, trackName, trackArtist, trackAlbum)
end if
delay 1
end repeat
end tell
on getSession()
tell application "Audio Hijack Pro"
set sessionName to "spotifySession"
try
set theSession to first session whose name is "spotify session" --By name
on error
set theSession to (make new application session at end of sessions)
end try
set name of theSession to sessionName
end tell
return theSession
end getSession
on recordTrack(theSession, trackName, trackArtist, trackAlbum)
tell application "Audio Hijack Pro"
tell theSession
split recording
set output folder to "~/Desktop"
set output name format to "%tag_title -- %tag_artist"
set title tag to trackName
set artist tag to trackArtist
set album tag to trackAlbum
end tell
end tell
end recordTrack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment