3 Replies Latest reply: Nov 24, 2012 8:08 AM by mabisoh
MattMabis Level 1 Level 1 (0 points)

I wrote this script in effort to have an applescript close all windows with more than one exception.  For example, if I had 10 tabs open, I may want it to only leave three critical work tabs open.


This script works to close all but the link shown.  I have not figured out how to get it to work on more than one tab.


Any suggestions would be appreciated.


tell application "Google Chrome"

          set windowList to every tab of every window whose URL does not start with "https://mail.google.com"

          repeat with tabList in windowList

                    set tabList to tabList as any

                    repeat with tabItr in tabList

                              set tabItr to tabItr as any

  delete tabItr

                    end repeat

          end repeat

end tell