How to use Apple Script to control a backlit keyboard?

Is there a way to use Apple Script to control the brightness of a backlit keyboard on a Macbook?

Illuminated keys are F5and F6.

Edit:

Based on the assumption @Clark, I tried to follow, but it does not work.

    NSAppleScript *run = [[NSAppleScript alloc] initWithSource:@"tell application \"System Events\" to key code 96"];
    [run executeAndReturnError:nil];

Any suggestions?

+5
source share
1 answer

Amit Singh has a chapter on how to do this with C.

http://www.osxbook.com/book/bonus/chapter10/light/

It would be easy to compile sample code on this page and call it from Applescript.

Applescript , key code. :

F1 122 F2 120 F3 99 F4 118 F5 96 F6 97 F7 98 F8 100 F9 101 F10 109 F11 103

, - :

" " key code 96

0

All Articles