Controlling Dashbboard

I just got an iMac from work that they no longer have use for. Free iMac, nice, but no keyboard or mouse. So I’d like to control it by voice alone, I’ve been able to script everything I want to do so far except tell dashboard to recede. I have tried “mousebutton” commands and set dashboard to the F1 key and tried “key code 103” (you can’t access the F12 button apparently). The computer recognizes my commands but still the dashboard stays up and I have to connect my mouse to click it down.

Does anyone know how I might get the dashboard to recede using applescript?

This works for me to activate/deactivate dashboard. Note that your key code is wrong for F12.

tell application "System Events"
	key code 111
	delay 2
	key code 111
end tell

Works great thanks Hank!