Event Handler Script for LadioCast
Added this AppleScript to LadioCast to update from Spotify Radio to Sonos with proper track metadata when on local radio:
set lastName to “”set lastArtist to “”set lastAlbum to “”repeattell application “Spotify”set trackName to name of current trackset trackArtist to artist of current trackset trackAlbum to album of current trackend tellif trackName is not lastName and trackArtist is not lastArtist and trackAlbum is not lastAlbum thenset lastName to trackNameset lastArtist to trackArtistset lastAlbum to trackAlbumtell application “LadioCast”set metadata song to trackName & ” – ” & trackArtist & ” – ” & trackAlbumend tellend ifdelay 15end repeat
Seems to work. In LadioCast you can choose this saved script to run as an “event handler” when playing your Icecast stream. One field from Sonos “TuneIn Radio” that I still haven’t been able to propagate is “On Now” but the track metadata shows up correctly under “Information” and Sonos updates each track via Growl.