This is a hack, but you can try to use xtool to close the windows. I place the following script in my login items. You may want to put in a delay of some sort.
You may also try iKey.
I use iKey to remap the keys. It has a little more function then youpi key. For many years, I used youpi key before switching to iKey.
You might like iKey/youpi key. I have my frequently used applications set to f keys. The same f key starts an application and switches to the application.
Youpi key is free. It works fairly well for me in MAC OS 10.4 although not officially supported. There is a commercial version you can buy, called iKey.
http://www.versiontracker.com/dyn/moreinfo/macosx/11485&vid=75326
This applescript could use some clean up. I do not think you need the first two lines.
do shell script "/usr/sbin/system_profiler SPDisplaysDataType | grep 'Resolution'" -- get info
tell the result to set {DisplayWidth, DisplayHeight} to {word 2, word 4} -- get resolution
--move mouse {DisplayWidth div 2, DisplayHeight div 2} -- center mouse
(*
move mouse {670, 13} --sound
click mouse
move mouse {673, 96} --sound level
click mouse
*)
move mouse {555, 282} -- center mouse
click mouse
(*
First, there is the XTools scripting addition, which will give AppleScript the ability to move the mouse.
http://www.lestang.org/osax/XTool/
XTool-2.0-src.dmg.tgz
Installation :
Drag XTool.osax from insite the image to one of the following locations (create the directory if it does not exist) :
a : ~/Library/ScriptingAdditions/
b : /Library/ScriptingAdditions/
c : /System/Library/ScriptingAdditions/
I have it in directory /System/Library/ScriptingAdditions/
My other two directories do not exit: ~/Library/ScriptingAdditions/ &
/Library/ScriptingAdditions/
. Next, you will need to place a script application into your login items (System Preferences > Accounts > Login Items) that will move the mouse when you log in:
*)
----------------------
This script will give you the location of the pointer. I assigned it to a function key with iKey. So, place the cursor of the x then press the function key to get where you need to click.
do shell script "/usr/sbin/system_profiler SPDisplaysDataType | grep 'Resolution'" -- get info
tell the result to set {DisplayWidth, DisplayHeight} to {word 2, word 4} -- get resolution
set {xWidth, yHeight} to position of the mouse
display dialog ¬
"DisplayWidth= " & DisplayWidth & ¬
" DisplayHeight=" & DisplayHeight & return & ¬
" xWidth=" & xWidth & ¬
" yHeight=" & yHeight
--move mouse {DisplayWidth div 2, DisplayHeight div 2} -- center mouse
---------------
You could try sending command + w to the finder. You can get the idea ... See this example, some work needed by reader!!!:
on open dropped_items
-- Write a message into the event log.
log " --- Starting on " & ((current date) as string) & " --- "
-- set see to alias "Macintosh-HD:Users:mac:Desktop:app.html"
-- set dropped_items to {see}
set the_app to "Safari"
repeat with dropped_item_ref in dropped_items
--set UrlBase to "xzzx FILE://" & POSIX path of dropped_item_ref
--display dialog UrlBase
-- Activate
activate application the_app
-- Open the URL
tell application the_app
open dropped_item_ref
-- print dropped_item_ref
tell application "System Events"
tell process the_app
delay 3
-- click menu item "Print..." of menu "File" of menu bar 1
keystroke "p" using command down
delay 1
keystroke return
delay 10
keystroke "w" using command down
end tell
end tell
--quit
end tell
end repeat
end open
Message was edited by: rccharles