Open chauncey-garrett opened 9 years ago
Trying out UI automation via JXA (Javascript Automation for Mac). I have the following code for the Search shortcut (⌥⌘F):
Sonos = Application('Sonos')
Sonos.activate()
delay(1)
SystemEvents = Application('System Events')
SonosUI = SystemEvents.processes['Sonos']
SystemEvents.keystroke('f', {
using: 'option down',
using: 'command down',
})
For some reason, this doesn't work. Very odd. If I simplify the script to work for Play/Pause
(⌘P), it works just fine:
Sonos = Application('Sonos')
Sonos.activate()
delay(1)
SystemEvents = Application('System Events')
SonosUI = SystemEvents.processes['Sonos']
SystemEvents.keystroke('p', {
using: 'command down',
})
I can get the search working properly with AppleScript. Doesn't seem to be related to Sonos.app.
I spent a little time making a small Mac app to control sonos. I'll post the project in the next day or so.
@kevnm67 Sweet! Keep me in the loop.
Until a better method is worked out, support the default keyboard shortcuts via GUI scripting.