Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Live Stream 'Now Playing' live text label
on is_running(appName)
tell application "System Events" to (name of processes) contains appName
end is_running
set iTunesRunning to is_running("iTunes")
set noMusic to "no music is playing"
set song to noMusic
if iTunesRunning then
set song to run script "tell application \"iTunes\" to if player state is playing then \"now playing: \" & name of current track & \" by \" & artist of current track"
return song
on error
return noMusic
end try
return noMusic
end if
# Adds the currently playing iTunes track to a text file for an OBS text label.
SONG=`osascript ~/bin/twitch-scripts/iTunesSong.scpt`
echo -e $SONG > ~/Documents/twitch/custom-labels/now-playing.txt
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
# run the following line in your terminal to load the launch agent:
sudo launchctl load ~/Library/LaunchAgents/twitch.song_updater.plist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.