通过AppleScript播放AirPlay扬声器

eec*_*cue 0 applescript itunes airplay

我已经取得了部分成功,让Indigo在iTunes 11中切换Airplay设备,但我需要一些帮助.我可以在一个扬声器上选择和切换,但我真的希望能够选择多个按钮,然后在我的所有或部分扬声器上切换.以下是我的工作原理:

tell application "iTunes" to activate
tell application "System Events"
   tell window "iTunes" of process "iTunes"
      click (first UI element whose help is "Choose which speakers to use.")
      keystroke "Master Bedroom" & return
      --perform action "press" in radio button "Multiple" of window "iTunes"--
   end tell
end tell
Run Code Online (Sandbox Code Playgroud)

所以代码打开它并突出显示主卧室线,但它实际上没有选中复选框,我玩了注释掉的线,但无法让它工作.思考?

小智 5

Airplay Device现在是一个可编写脚本的对象 - 不需要UI技巧.

例如

告诉应用程序"iTunes"获取AirPlay设备的名称

告诉应用程序"iTunes"将选定的AirPlay设备"主卧室"设置为true