1

I would like to create an automated brightness/dimming chase on my Mac OS Yosemite 10.10.5 using Applescript,

I found this script>>

Dimmer: tell application "System Events" key code 107 end tell

Brighter: tell application "System Events" key code 113 end tell

What I would like to do now is to repeat that action and control the speed/timeframe of the dimming,

Any Applescript expert able to help on that?

Thanks!!!

1 Answer 1

1

Only because you asked... The code below is an example of using a repeat statement and delay commands with your code.

That said, I do not believe it is going to give you the desired results because while the events will trigger in code nonetheless they'll probably not be processed at the hardware level. (It doesn't on my system.)

You can change the numeric value in the repeat statement to suite your needs. The value is an integer, as in repeat integer [times].

The delay command shown in decimal seconds as in delay number being the number of seconds to delay. The number may be fractional, such as 0.5 to delay half a second.


repeat 3 times repeat 10 times tell application "System Events" key code 107 end tell delay (0.1) end repeat repeat 10 times tell application "System Events" key code 113 end tell delay (0.1) end repeat end repeat 
1
  • Hey cool, thanks !!! this is really helpful! I'll just play with the value now Commented Jul 29, 2016 at 10:54

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.