Not sure the double click on empty space can be done, but I'm sure it would be kinder to ask the Finder to quit rather than kill it... Finders have feelings too ;-)
You could always save it as an app & put it in the Dock.
tell application "Finder" to quit
-- /*give it time, otherwise it will try to activate before it's quit & this simple version won't check if it relaunched.*/
delay 2
try
tell application "Finder" to activate
end try
--my testFinderRunning() --/*uncomment to add the belt & braces method*/
Add this routine to make sure it relaunched
on testFinderRunning()
set test to 0
repeat while test = 0
log test
tell application "System Events" to set test to count (every process whose name is "Finder")
delay 2
--/*we do this even if active because it doesn't naturally come to front.*/
try
tell application "Finder" to activate
end try
if (test > 0) then exit repeat
end repeat
end testFinderRunning
You can put the Applescript menu in the menu bar - http://thepoch.com/tumblr/enable-the-script-menu-in-mac-os-xs-menu-bar.html short version... launch Applescript, get Prefs, set 'Show script menu in menu bar'
That may allow you to assign Key Commands from System Prefs/Keyboard, but I haven't had time to test yet.