Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.4: Open Dashboard at login with AppleScript' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Open Dashboard at login with AppleScript
Authored by: cougar718 on Aug 18, '05 05:22:29PM
Hello all,

I wrote an application to accomplish what this hint set out to do. The only thing this application will do differently is take a lot less CPU and won't show the spinning cursor.

Just copy the below code into a new script. Save the script as an application and make sure 'Stay Open' is checked off. Then configure the 2 properties in order to customize it to your environment.

Good luck!


-- Funct=ion Key Values
(*
F1  - 122 
F2  - 120 
F3  - 99 
F4  - 118 
F5  - 96 
F6  - 97 
F7  - 98 
F8  - 100 
F9  - 101 
F10 - 109 
F11 - 103 
F12 - 111 
F13 - 105 
F14 - 107 
F15 - 113
*)

-- Configure how long do we wait until Dashboard is closed/deactivated
property intWaitDelay : 10 -- Seconds
-- Configure which key we press for Dashboard to be triggered.
property intFunctionKeyValue : 118 -- F4

-- Application's properties
property dateGoal : ""

on run
	tell application "System Events" to key code 118
	-- Add our Wait Delay to the current date
	set dateGoal to (current date) + intWaitDelay
end run

on idle
	if ((current date) is greater than or equal to dateGoal) then
		tell application "System Events" to key code 118
		quit -- Exit
	end if
	return 1
end idle

---
Rick alias cougar

[ Reply to This | # ]