I'd like the most direct way, on a Mac, to launch an Apple Music "radio" station e.g.
- via the command line, without having to manually navigate to the radio tab in iTunes, waiting for it to load, scrolling to find the station etc.
- avoid having to load a URL in Safari first, then wait for iTunes to load (annoying there always seems to be a few seconds delay between the webpage loading and iTunes navigating to the stream).
I attempted to do it with AppleScript.
The link to stations (get it via right click and Share Station) is in this format:
https://itunes.apple.com/gb/station/classical/ra.123456789
(I've obfuscated the numeric ID, just in case it's unique to the logged in user).
Whenever I tell iTunes to open the actual URL, instead what it does is open the last "ordinary" (non-Apple) station I played.
[AppleScript]
tell application "iTunes" to open location "https://itunes.apple.com/gb/station/classical/ra.123456789?ign-mscache=1"
Yet if you look at the webpage the http:// URL gives you (the Connecting to the iTunes Store one) there doesn't seem to be anything different/special in the body onload
javascript.