Friday, December 2, 2022

#1 2022-11-18 02:54:30 am

maccajm
Member
Registered: 2022-11-16
Posts: 1

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


Applescript:


-- 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.

Last edited by Nigel Garvey (2022-11-18 07:36:24 am)

Offline

 

#2 2022-11-20 04:34:02 am

KniazidisR
Member
From:: Greece
Registered: 2019-03-03
Posts: 2588

Re: Ventura finder window script bugs

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:

Applescript:


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.

Last edited by KniazidisR (2022-11-20 08:16:00 am)


Model: MacBook Pro
OS X: Catalina 10.15.7
Web Browser: Safari 15.6.1
Ram: 4 GB

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)