PDA

View Full Version : AppleScript to auto close an ejected volume's windows


fab
Sep 13, 2006, 02:41 PM
While waiting for CocoaTech to add this feature to the next version of PathFinder (see http://www.cocoatech.com/forum/showthread.php?t=3142), I just finished to write a simple AppleScript which automatically closes all the opened browser windows eventually showing the content of a volume before ejecting it.
Just put it into your PathFinder toolbar and click on its "Eject&Close" icon when the PathFinder's front window is showing the content of a disk image or network disk (or of a disk image/network disk's subfolder): the script will automatically close all windows (if any) showing the content of the parent volume, then such a volume will be ejected.
The script is saved as an app bundle (eject icon included) but it's editable with the Apple Script Editor, if anyone wishes to improve it.

lucite
Oct 19, 2006, 05:47 PM
Very cool. Nice Icon, too.

k3vin
Apr 10, 2007, 07:16 PM
Nice, but I get an error message after image is unloaded.

"NSReceiverEvaluationScriptError: 4"

Any idea how to fix?
Good work otherwise!