Skip to content

Instantly share code, notes, and snippets.

@Lucien
Forked from poritsky/track-to-text.applescript
Last active January 27, 2017 22:58
Show Gist options
  • Save Lucien/5218093 to your computer and use it in GitHub Desktop.
Save Lucien/5218093 to your computer and use it in GitHub Desktop.
Get current stream title if available, otherwise show song's current artist - name
# Get current song, album and artist from iTunes.
#
# Intended for use with Smile Software's TextExpander:
# http://www.smilesoftware.com/TextExpander/index.html
#
# Set up as a snippet to turn current track into text. A nice way to spin your wheels while writing/coding/contemplating the shape of the universe.
tell application "iTunes"
set current_song to the name of current track
set current_artist to the artist of current track
set current_stream to the current stream title
end tell
if current_stream exists then
return "📻 " & current_stream
else
return "🎧 " & current_artist & " - " & current_song
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment