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!!!
Best Answer
Only because you asked... The code below is an example of using a
repeat
statement anddelay
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 inrepeat integer [times]
.The
delay
command shown in decimal seconds as indelay number
being the number of seconds to delay. The number may be fractional, such as 0.5 to delay half a second.