Re: Scripting Date and Time Control Panel
Re: Scripting Date and Time Control Panel
- Subject: Re: Scripting Date and Time Control Panel
- From: Andy Wylie <email@hidden>
- Date: Sat, 24 Nov 2001 22:08:19 +1300
on 24/11/01 7:14 PM, Gnarlodious at email@hidden wrote:
>
What I want to do is update my OS Clock with a script:
>
AFAIK it's still not scriptable, I use Akua's 'input state'...
----------------
-- Open date and time control panel
tell application "Finder"
open alias ("" & {path to "ctrl", "Date & Time"})
end tell
-- Select "Server Options"
input state {pointer location:{457, 310}}
input state {button down:true}
-- Select "Set Time Now"
input state {pointer location:{297, 289}}
input state {button down:true}
-- Close
input state {pointer location:{520, 290}}
input state {button down:true}
-- Close
input state {pointer location:{196, 62}}
input state {button down:true}
----------------
>
Is this even possible? Record does not work here.
%)
your coordinates will likely vary so here's a script you can save as an
applet to get coordinates of the various controls...
----------------
property butz1 : {"Snap Coords", "Cancel"}
property butz2 : {"Repeat", "Done"}
property bla1 : "Place the cursor at the desired position and press the
enter key"
property bla2 : "The coordinates {"
property bla3 : "} are on the clipboard "--I lie but they'll get there
dlg1()
on dlg1()
display dialog bla1 buttons butz1 with icon -19133 default button 1
set dlgRslt to button returned of result
if dlgRslt = "Snap Coords" then return dlg2()
end dlg1
on dlg2()
set {x, y} to pointer location of (input state) --Akua Sweets OSAX
display dialog bla2 & {x, " : ", y, bla3} buttons butz2 with icon -20020
default button 1
set dlgRslt to button returned of result
if dlgRslt is "Done" then
set the clipboard to "{" & { x, ",", y, "}"}
return
else
return dlg2()
end if
end dlg2
----------------
works good run from a Finderpop script...
----------------
run script alias "blah:blah:pointer location"
_____________________________ Andy