Skip to content

Instantly share code, notes, and snippets.

@DominikPeters
Created December 4, 2021 15:13
Show Gist options
  • Save DominikPeters/ca0935f332a68fcfef97383590229a6f to your computer and use it in GitHub Desktop.
Save DominikPeters/ca0935f332a68fcfef97383590229a6f to your computer and use it in GitHub Desktop.
AppleScript for closing all incognito windows of Google Chrome
tell application "Google Chrome"
set allWindows to get every window
repeat with i in allWindows
set windowProperties to properties of i
set windowMode to mode of windowProperties
if windowMode is "incognito" then
close i
end if
end repeat
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment