javascript - How to close dashboard programmatically using AppleScript? -


i'm developing small dashboard widget allows user open system preference pane.

opening preference pane no problem (but looks awful :p)

widget.system('osascript ' +               '-e \'tell app "system preferences" activate\'' +               '-e \'<snip…> open correct pane\'') 

the problem if preference pane opens, dashboard stays open too.

i have found ways of opening it:

tell app "dashboard" launch 

but no way close it, close raises exception , quit nothing :/

does know how this?

try:

tell application "dashboard" launch delay 3 tell application "finder" activate 

or maybe keystroke...

tell application "system events" key code 53 

Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -