Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting song name of streaming track in iTunes with Applescript

How can I get the name of the song of current track in iTunes when this track is a radio?

I mean the string(s) that appears right below the radio name :)

enter image description here

Quering its name like below gives me the name of the radio (Trance Channel - DIGGITALLY IMPORTED - we can't define it!)but not the song

tell application "iTunes"
    set thisTrack to current track
    set trackName to the name of thisTrack
    set trackTime to thisTrack's time
end tell

which is expected since the info in my library is: enter image description here but is there a way to specially deal this streaming tracks? and get their info correctly like iTunes does in the first picture? I know current track is a radio because its time will be missing value and not of the form MM:SS if that helps a bit.

Is this possible?

like image 526
nacho4d Avatar asked May 04 '12 05:05

nacho4d


People also ask

How do you get track names on iTunes?

Click the Options button near the top right of the iTunes window, then choose Get Track Names. Select the entry for the CD. If there's more than one entry for the CD you're looking up, select the first one to see if it includes the correct information. If it doesn't, choose Get Track Names again, and try another entry.

Does Apple music keep track of streams?

Apple Music Replay calculates your top songs, albums, and artists throughout the year using: Your listening history in Apple Music. The amount of plays and time spent listening to a song, artist, or album.


1 Answers

It appears that, in iTunes 12.2, a whole variety of interesting things are going on.

  1. current stream title returns missing value when requesting the name of a stream coming from "For You" (e.g. something not in your current music library). name of the current track doesn't exist. For example, I'm listening to "Alternative Gems: 1994" from "For You" right now (Yay- grad school days) and I can't get any information about what is playing. If I go to the album the track is playing from to play something else, missing value and error -1728 on name of current track too.

  2. When listening to Beats 1 radio as per @ivan above, I also get missing value but for name of the current track I get "Beats 1". As @dougscripts points out, the stream title stuff varies all over the map.

  3. Listening to a radio station created via a "For You" seems to give me the correct name of the current track.

So, in short, chaos.

like image 81
flip Avatar answered Oct 04 '22 21:10

flip