Apple script and keystroke

Posted on
Sun Nov 15, 2015 5:58 pm
ELWOOD offline
Posts: 225
Joined: Feb 11, 2007
Location: Ramsey, NJ

Apple script and keystroke

I am using Kodi media server for all my movies. Most of the control of Kodi I use a trac pad. My Denon receiver is controlled through indigo and
working volume and switching inputs is with a remote linc 2. I can toggle Kodi between fullscreen and windowed with F+command on the keyboard
but watching movies I don't keep the key boar handy. I am trying to set up a button on the remote linc2 to do the toggling using apple script but can't
get it working.

Set up a trigger on the button that runs the below apple script:


try
tell application "Kodi"
activate
delay 2

tell application "System Events" to keystroke "F" using {command down}
end tell
end try

The script complies and runs without error, but won't toggle the display.
The first part works and Kodi is activated to the top window but thats it.

Any suggestions or a different way to do this would be appreciated.

Thanks
Elwood

Posted on
Mon Nov 16, 2015 12:20 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Apple script and keystroke

So, the Kodi app isn't scriptable? I'm not that familiar with system events, but don't you have to have accessibility turned on for it to work?

[MODERATOR NOTE] moved to a more appropriate forum since it's not a question specifically about Indigo.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Nov 16, 2015 12:47 pm
ELWOOD offline
Posts: 225
Joined: Feb 11, 2007
Location: Ramsey, NJ

Re: Apple script and keystroke

Hi Jay
Running on a mac mini (10.9.5), under sys preference: privacy/accessibility AppleScript Utility is checked.
There is no "+" to add Kodi. or other programs. I think past versions you could add other programs.


Elwood

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 5 guests