2

I have an HomePod and I want to listen Radio in iTunes on morning. So far it's not possible to set an alarm using a playlist or a radio in the HomePod settings.

So I decided to use iTunes on my Mac applescript in calendar (to launch it every day).

I found a way to target the HomePod using this command in AppleScript :

tell Application "iTunes"
 set current Airplay devices to Airplay device "kitchen"
End tell 

My problem is the radio. There is a Radio section in iTunes where you can find Beats 1 but other radios selected by Apple. I want to play one of this radio.

I try many ways but couldn't find a nice way to do it...

I tried :

 play track myRadio of playlist myRadio

or source myRadio" play myRadio

Nothing work.. I would like to know how to access the Radio section in iTunes. Which is a spacial kind of section.

I found away to do it but It's not reliable :

open url (and use the radio Url from iTunes)

Using the script I was able to get the object's information :

 get name of current track
 --> "Name of currently payed track iTunes selected"
 get name of current playlist
 --> "Name of my radio station"

Thanks

1
  • Did you want it to play a random radio station or just a specific one?
    – chrisjr
    Commented Jul 6, 2018 at 23:13

2 Answers 2

1

Try this:

open location "itmss://itunes.apple.com/us/station/listen-in-apple-music/idra.686227433?cmd=AddStation"
0

This is a pretty old thread but I thought I'd post an AppleScript solution (which can be embedded in Shortcuts) for accessing an Apple Music radio station.

You need to copy the "embed url" code from the share sheet in Apple Music for the radio station on Apple Music of your choice. Once that's done, replace everything from the "embed url" script into the following code (starting with station). Make certain that you keep the "?app=music" as shown.

Here's the code (seems so simple but took me too much time to discover):

open location "itmss://music.apple.com/us/station/holiday-station/ra.747154894?app=music"

Works for me on Apple macOS Monterey and a subscription to Apple Music. And, as mentioned, it can be embedded into an Apple macOS shortcut using the Run AppleScript option. It will look like this:

on run {input, parameters}
    open location "itmss://music.apple.com/us/station/holiday-station/ra.747154894?app=music"
    return input
end run

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .