[QLab] Screen black out, dim & restore via applescripts

284 views
Skip to first unread message

*

unread,
Aug 28, 2010, 8:47:44 PM8/28/10
to Discussion and support for QLab users.
Greetings,

I'm using the scripts below to control the brightness level of the control
monitor for a 2 monitor rig. 1 - control / 1 - video

The script functions as desired but it also opens up the system preference
window for displays but then leaves it open.

I would assume the window HAS to be opened to make the adjustment but so
far I can't figure out how to have the "pane" close before the script is
closed.

I'm assuming that this line,

tell application "System Preferences" to reveal anchor
"displaysDisplayTab" of pane "com.apple.preference.displays"

should be easily "unrevealed" but so far nothing I try works & I can't
find the opposite command yet.

---------------------------------------------------------------------------

to turn the brightness of the screen down to 0 / off:

tell application "System Events"
tell application "System Preferences" to reveal anchor
"displaysDisplayTab" of pane "com.apple.preference.displays"
tell process "System Preferences"
set value of slider 1 of group 2 of tab group 1 of window 1 to 0
end tell
end tell

to turn the brightness of the screen up to full:

tell application "System Events"
tell application "System Preferences" to reveal anchor
"displaysDisplayTab" of pane "com.apple.preference.displays"
tell process "System Preferences"
set value of slider 1 of group 2 of tab group 1 of window 1 to 1
end tell
end tell

NOTE - the only difference between the two scripts is the last number
which is either 0 or 1. You can also specify a number between 0 & 1. For
example, .5 = 1/2 brightness & so on.

If you use these, make sure you disable "Automatically adjust brightness
as ambient light changes or else your mid bright levels well be
overridden.

I would guess although I don't have a second monitor that if there is more
than 1 monitor, the same scripts could be modified to control those as
well but maybe not. Maybe this is only useful for an on board mac screen
such as those found on Imac & Macbook products.

FYI- these script worked fine via the applescript editor but not in Qlab
until I followed the instructions here:

http://figure53.com/wiki/index.php?title=QLab_Scripts_and_Macros#Using_the_Script_menulet

Best Regards,

*

________________________________________________________
WHEN REPLYING, PLEASE QUOTE ONLY WHAT YOU NEED. Thanks!
Change your preferences or unsubscribe here:
http://lists.figure53.com/listinfo.cgi/qlab-figure53.com

Rich Walsh

unread,
Aug 28, 2010, 9:05:08 PM8/28/10
to Discussion and support for QLab users.
On 29 Aug 2010, at 01:47, * wrote:

> I'm assuming that this line,
>
> tell application "System Preferences" to reveal anchor
> "displaysDisplayTab" of pane "com.apple.preference.displays"
>
> should be easily "unrevealed" but so far nothing I try works & I can't
> find the opposite command yet.

Have you tried just sticking this line in at the end of the script?

tell application "System Preferences" to quit

Rich

Sean Dougall

unread,
Aug 28, 2010, 10:20:10 PM8/28/10
to Discussion and support for QLab users.
Alternatively, if you wanted to keep System Prefs open in the background, but switch back to QLab, you could add this instead:

tell application "QLab" to activate

-Sean

*

unread,
Aug 28, 2010, 11:43:11 PM8/28/10
to Discussion and support for QLab users.
The following works perfectly.

Thanks Rich!!!

I wonder if the "pane" needs to be opened in the first place or if the
adjustment could just be made without opening it.

Not that it matters since the solution closes it right after it opens but
just wondering to what extent applescripts have access to the nuts & bolts
of the OS.

*

-------------------------------------------------------------------

tell application "System Events"


tell application "System Preferences" to reveal anchor
"displaysDisplayTab" of pane "com.apple.preference.displays"

tell process "System Preferences"
set value of slider 1 of group 2 of tab group 1 of window 1 to 0

tell application "System Preferences" to quit

end tell
end tell

*

unread,
Aug 28, 2010, 11:46:59 PM8/28/10
to Discussion and support for QLab users.
Thank you Sean!!!

*

On Sat, August 28, 2010 9:20 pm, Sean Dougall wrote:
> Alternatively, if you wanted to keep System Prefs open in the background,
> but switch back to QLab, you could add this instead:
>
> tell application "QLab" to activate
>

Reply all
Reply to author
Forward
0 new messages