Skip to content

Instantly share code, notes, and snippets.

@jamesstout
Created July 13, 2013 10:47
Show Gist options
  • Save jamesstout/5990309 to your computer and use it in GitHub Desktop.
Save jamesstout/5990309 to your computer and use it in GitHub Desktop.
AppleScript to close all Finder Get Info windows
tell application "Finder"
set theWindowList to windows (* get all Finder windows *)
repeat with i from 1 to number of items in theWindowList (* loop through them *)
set this_item to item i of theWindowList (* get a window from the *)
set windowName to name of this_item (* get the window's name*)
if windowName ends with " Info" then (* see if the window name ends in " Info" - NOTE the space *)
close this_item (* ENHANCEMENT: Would also close a Finder window that had a folder open that ended in " Info" *)
end if
end repeat
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment