Ventura finder window script bugs

I have a finder script that does the following:

– Closes all finder windows

  • Checks to see if the laptop has any monitors attached or not
    – Then it creates three new finder windows at equal sizes all in column mode

I have used this script for a VERY long time and through many OS updates and had no problems. However under Ventura for some reason the windows appear at random places on the screen!

Any ideas?

Thanks

J


-- 4k 3000 x 2000
-- 5k 2500 x 1500

tell application "Image Events"
	set theDisplays to count of displays
end tell

tell application "Finder"
	
	if theDisplays > 1 then
		-- external monitor connected
		-- 4k 3000 x 2000
		set base to 0
		set wd to 2500
		set to_height to 1550
		set gap to 50
		set he to (to_height / 3)
	else
		-- built in monitor
		-- 1800 x 1200 g50
		set base to 0
		set wd to 1800
		set to_height to 1200
		set gap to 80
		set he to (to_height / 3)
	end if

	try
		close windows
	end try
	
	make new Finder window
	set current view of Finder window 1 to column view
	set properties of window 1 to {bounds:{8, base, wd, he}}
	set position of Finder window 1 to {6, base}
	
	make new Finder window
	set properties of window 1 to {bounds:{8, base, wd, he}}
	set position of Finder window 1 to {6, (he + gap)}
	
	make new Finder window
	set properties of window 1 to {bounds:{8, base, wd, he}}
	set position of Finder window 1 to {6, (he + he + (gap * 2))}
end tell


[AppleScript] tag corrected to lower case by NG.

set properties of window 1 to {bounds:{8, base, wd, he}}

I don’t know if it is the Ventura bug or not, but the code line above has normal syntax to not replace all the properties of window with bounds only:


set bounds of window 1 to {8, base, wd, he}

Also, counting displays with Image Events may be buggy. Count them with System Events better.

I am on Catalina, so can’t help more.