Skip to content

Instantly share code, notes, and snippets.

@pythoninthegrass
Forked from Koze/CloseAllWindows.scpt
Last active November 1, 2022 17:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pythoninthegrass/8c9a0b98ef95e58656f32a3f9ca447f0 to your computer and use it in GitHub Desktop.
Save pythoninthegrass/8c9a0b98ef95e58656f32a3f9ca447f0 to your computer and use it in GitHub Desktop.
Close all windows with AppleScript
#!/usr/bin/env bash
# SOURCE: https://gist.github.com/Koze/2e1a9bf967b2bf865fc9
# close all windows (e.g., thousands of finder windows from unarchiver)
osascript -e 'tell application "Finder" to close windows'
## index 1 is frontmost window
# osascript 'tell application "Finder" to close window 1'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment