How to minimize all chrome windows except one selected?

Hi,

I can’t create an applescript that minimizes all chrome windows except one selected
Can you help me?

thanks

Do you mean something like this? Minimizes all but the frontmost window.

tell application "Google Chrome"
	repeat with i from 2 to count of windows
		set minimized of window i to true
	end repeat
end tell

Sometimes there only 1 window except the front one is reduced and not all the others in a single execution of the script
you have to rerun the script to reduce the remaining window except the front one

I don’t know to use Scritp Debugger so i ask you what does Script Debugger return about this script

This works better for me:

tell application "Google Chrome"
   set chromeWindows to every window
   repeat with thisWindow in the rest of chromeWindows
      set minimized of thisWindow to true
   end repeat
end tell

Open this in Script Debugger.

In the Script menu make sure there’s a √ on “Enable Debugging”

In the View menu make sure there’s a √ on “Results and Variables Tab”

From the script menu choose “Step Into” and at each step you can see the results of execution, and see the values of the variables as they change.

(Also, all of those Script Debugger commands have icons in the tool bar which makes it much easier).

THanks !!

Now,how to modify the last script to reopen all chrome windows that have been minimized?

You could simply copy that script, and change:

set minimized of thisWindow to true

to

set minimized of thisWindow to false

or, even this would work

tell application "Google Chrome"
   set the minimized of every window to false
end tell

Thanks !

Now,I need 2 applescripts :
1)to minimize all windows except one selected

2)to disable fullscreen mode of all windows that are fullscreen
Chatgpt gave me this but not sure if this apple script is valid:

tell application “Google Chrome”
[indent]set chromeWindows to windows
[indent]repeat with thisWindow in chromeWindows
[indent 2x]if fullscreen of thisWindow is true then
[indent 3x]set fullscreen of thisWindow to false
[indent 2x]end if
[indent]end repeat
end tell

Yeah, that won’t work. “fullscreen” is not a property of a google window.

Try this

tell application "Google Chrome"
	set the zoomed of every window to false
end tell

(Nice try, AI)

If a window is full screen, setting the zoomed to false takes it out of full screen. But setting zoomed to true doesn’t put it in full screen, it just fills the window below the menu bar.

Or:

tell application ("Google Chrome") to tell ¬
		windows 2 thru -1 to set minimized ¬
		to true