PDA

View Full Version : Close Other Windows script


hombre
Jan 16, 2006, 10:16 PM
In PF3, I used the following Applescript (triggered by a keyboard shortcut Cmd-Shft-W using Keyboard Maestro (other similar programs would work)) to close all windows except the front one:

tell application "Path Finder"
close (every window whose index is not 1)
end tell

In PF4, that script now appears to close all open windows, but the following seems to work:

tell application "Path Finder"
close (every window whose index is not 2)
end tell

I don't actually understand any of this because I don't know Applescript. FWIW, the one I am using for the Finder is:

tell application "Finder"
close (get every window whose index is not 1)
end tell


Be advised that things can get unpleasantly weird in combination with the PkgInfo hack. I am waiting until the dust settles, as it were, to mess with that again.

redrocklobster
Aug 04, 2006, 02:26 PM
the command "make new finder window" doesn't work even though the class "finder window" is supported by PFF

grotsasha
Aug 04, 2006, 02:39 PM
There are a bunch of applescript bugs that are corrected in the lab, so applescript should be more stable in the next version. For the examples of working scripts, please, look at this thread:

http://www.cocoatech.com/forum/showthread.php?t=2869