Re: Unvirtual ambient photon quotient
Re: Unvirtual ambient photon quotient
- Subject: Re: Unvirtual ambient photon quotient
- From: Robert Poland <email@hidden>
- Date: Sun, 11 Jan 2004 09:44:06 -0700
Considering that the planet orbits the star flopped on its side is there
some way to access an online database to tell me when the sunrise/sunset is
for the day in question?
For example, I could say (pseudocode):
if timeOfDay > 0600 OR < 1800 then set screenBrightness to hotScreen
if timeOfDay > 1800 OR < 0600 then set screenBrightness to coldScreen
This scheme might work on a boring unfloppy planet but not this one.
As a flight of fancy, Apple needs an appendage to its timeserver that sets
the screen brightness according to the longitude of the entity. Cool, huh?
-- Gnarlie
Here's one I use, has a few extra features.
Triggered by iBeeZz and other scripts. Slightly
more complex.
(* brightness 5 - 11/30/03
from Kai
11/30/03 - modified to step to new value
12/4/03 - test for setting not needed
12/26/03 - test for Preferences running - don't quit if it was running
*)
set v to 64 -- modify as required (integer between 0 and 128)
set v to v / 128 -- convert to increments of 1/128
set stepValue to 1 / 64 -- controls slider speed (must be a multiple of 1/128)
tell application "Finder"
set PreferencesRunning to (processes
whose name = "System Preferences") {}
if not PreferencesRunning then
tell application "System Preferences" to activate
repeat until (some process whose creator type is "sprf") exists
end repeat
end if
end tell
tell application "System Preferences"
run
set current pane to pane "com.apple.preference.displays"
end tell
tell application "System Events" to tell process
"System Preferences" to tell window 1 to tell tab
group 1
tell radio button "Display" to if value is 0 then
click
repeat until value is 1
end repeat
end if
tell slider 1 of group 2
if value v then
set x to value
if x > v then set stepValue to -stepValue
set value to x + (v - x) mod stepValue
repeat (v - x) div stepValue times
set value to value + stepValue
end repeat
end if
end tell
tell application "System Events"
tell process "System Preferences"
set frontmost to true
keystroke "l" using
command down -- switch to view all window
end tell
end tell
end tell
tell application "Finder"
if not PreferencesRunning then -- don't quit if it was running
tell application "System Preferences" to quit
repeat until not ((some process
whose creator type is "sprf") exists)
end repeat
else
tell application "System Events"
set frontmost to true
keystroke "h" using
command down -- set visibility of "System
Preferences" to false
end tell
end if
end tell
--
Bob Poland - Englewood, CO
http://www.ibrb.org/
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.