The Dim Screen verb performs a full or partial gamma fade on one or more connected screens. This is separate from allowing the screen to go to sleep as just dimming the screen to 0% will not cause it to actually power off, though this will not affect the normal sleeping of the screen. This could be used to control the brightness of an attached display screen to adjust to lighting or time of day.
All screens will be restored to 100% of brightness if Xtension is quit while they are in a dimmed state.
Dim Screen (optional, screen index defaults to all screens) to (integer, 0 to 100, the percent brightness of the screen) rate (optional, float, the seconds to take to dim the screen to the new level)
Screen indexing starts at 1 for the “main” screen with the menu bar. Additional screens will start at 2. Passing a screen number less than 1 or more than the actual number of screens will return an out of range error. If the screen may or may not be connected wrap the call in a try/onerror block.
Note: the Rate parameter is unimplemented as of XTension 9.4.32 the screen will change dim levels instantly. This will implemented in a future build.
To dim all connected screens to 50%
dim screen to 50
To return all screens to normal 100%
dim screen to 100
To dim just the second screen to 25%
dim screen 2 to 25