Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Honza1

macrumors 6502a
Original poster
Nov 30, 2013
933
433
US
Hello,

for few days now I am banging my head on trying to create script to start iTunes radio station. Not URL station, but one of those new iTunes radio stations which one can find in Music under tab "Radio". I created my own "station" and want to start it from other program.

Those "native" iTunes radio stations seem to look like playlists, here is what I get when I ask iTunes for information:
******
Code:
tell application "iTunes"
	get name of current track
		--> "Name of currently payed track iTunes selected"
	get name of current playlist
		--> "Name of my radio station"
end tell
******
But when I try to set the playlist and play first track, I get error:

tell application "iTunes" to play (first track of playlist "Name of my radio station")
*****
	play track 1 of playlist "Name of my radio station"
		--> error number -1700
Result:
error "iTunes got an error: Can’t make some data into the expected type." number -1700 to item
*****
Dictionary was not much help. It's like this relatively new component of iTunes is not yet supported by Applescript?

Anyone ideas anyone?

Thanks
 
Last edited by a moderator:

kryten2

macrumors 65816
Mar 17, 2012
1,114
99
Belgium
What's the result of class of current track?

Code:
tell application "iTunes"
	class of current track
end tell
 

Honza1

macrumors 6502a
Original poster
Nov 30, 2013
933
433
US
Here is the result:

Code:
tell application "iTunes"
	get class of current track
		--> file track
end tell
Result:
file track

Any suggestions? Thanks...
 
Last edited by a moderator:

Partron22

macrumors 68030
Apr 13, 2011
2,655
808
Yes
It's like this relatively new component of iTunes is not yet supported by Applescript?
Similar things have happened in the past. I did a bit of Applescript futzing w the radio station playlists, and came up empty. They don't seem to be enumerable or have visible properties.
 

obycode

macrumors newbie
Aug 28, 2014
2
0
I take it you were never able to solve this? I have been trying everything I can think of just to resume playing an iTunes Radio station but have not had any luck either.
 

yalag

Suspended
Nov 18, 2007
1,448
81
Anyone find a solution to this? The closest I can do is open the url of the radio station in apple script but that leaves an annoying safari window open
 

Red Menace

macrumors 6502a
May 29, 2011
578
226
Colorado, USA
What version are you using? A ways back there was an issue if the playlist just had a single radio station in it, but that seems to have been corrected (at least as of v12.4). What I did for earlier versions was to just add a sound file to the playlist after the radio station entry (it doesn't have to be enabled).
 

yalag

Suspended
Nov 18, 2007
1,448
81
What version are you using? A ways back there was an issue if the playlist just had a single radio station in it, but that seems to have been corrected (at least as of v12.4). What I did for earlier versions was to just add a sound file to the playlist after the radio station entry (it doesn't have to be enabled).

How do you even add radio stations to playlists?
 

yalag

Suspended
Nov 18, 2007
1,448
81
The only menu you get from the station is "share station". There are no other options. You can't even add it to your library
 

Red Menace

macrumors 6502a
May 29, 2011
578
226
Colorado, USA
The only menu you get from the station is "share station". There are no other options. You can't even add it to your library
I'm not sure what you are talking about - the current flavor of iTunes is more interested in selling you a stream subscription from the store, but I am referring to a radio station added to iTunes as in the original topic posted 2 years ago.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.