macosapplescriptitunes

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?


Solution

  • I looked in the applescript dictionary for iTunes and searched for "stream"...

    tell application "iTunes"
        current stream title
    end tell