Play random tracks from playlist

Curious. Presumably that does not play a random track though. I expect for you:

tell app "iTunes" to tell user playlist "1 focus" to play some track

would likely work well.

Which begs the question - what does iTunes consider a “source”, as that seems to be the obvious difference between your AppleScript and Keyboard Maestro’s.

For me, the first source is the library, then Internet Radio (?!), then the store, then my iOS devices.

Anyway, I’ve simplified the AppleScript in Keyboard Maestro to:

tell app "iTunes" to play track "whatever"
tell app "iTunes" to tell playlist "whatever" to play first track
tell app "iTunes" to play some track
tell app "iTunes" to tell playlist "whatever" to play some track

So hopefully that will resolve the issue for anyone else going forward.

Thanks.