Domanda

I have had partial success getting Indigo to toggle Airplay devices on in iTunes 11, but I need some help. I am able to select and toggle on one speaker, but really I want to be able to select the multiple button and then toggle on all or some of my speakers. Here is what I have that works for one:

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

So that code opens it up and highlights the Master Bedroom line, but it doesn't actually select the checkbox, I played around with the commented out line, but couldn't get it to work. Thoughts?

È stato utile?

Soluzione 2

This does it for me:

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 "Kitchen" & return
        delay 1
        key code 76
    end tell
end tell

I have been struggling with this ever since 11 came out. key code 76 is the enter key.

Altri suggerimenti

Airplay Device is now a scriptable object - no need for UI tricks.

e.g.

tell application "iTunes" to get name of AirPlay devices

tell application "iTunes" to set selected of AirPlay device "Master Bedroom" to true

I don't have iTunes with me now, but the syntax to select the checkbox with System Events should be click checkbox "Multiple"

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top