Is there a simple script to close the folder when I launch a file?
-ajlewis
This is simple. Hold down the Left Control key and Right Click on an object. The object opens and the parent window closes. The folder always closes but sometimes the file doesn't open (it's a timing thing), which can be irritating. But it is simple
;CloseParent.ahk
;
;In an Explorer Window, hold down Left-Control and RightClick on a
;folder,shortcut,or file. The folder/shortcut/file will open/run
;and the Explorer Window will close.
;
;If you LeftControl-RightClick anyplace other than an object,
;eg a window background, the window will close, very handy
;
;sometimes the timing doesn't work, hence the sleeps
#SingleInstance,Force
#Persistent
Menu,Tray,Tip,CloseParent
LControl & RButton::
MouseGetPos,xpos,ypos,ParentWin
sleep, 100
MouseClick,Left,%xpos%,%ypos%,2
sleep, 200
Winclose,ahk_id %ParentWin%
return