Sunday, May 9, 2021

#1 2021-04-27 09:03:17 am

TheBlackBinLiner
Member
Registered: 2019-12-05
Posts: 27

Merge All Windows of menu

Hi all,

I've upgraded to Mojave 10.14.6 today and the following Applescript no longer merges the initial windows as expected.
It opens all windows as listed below but does not do the tell Finder process click menu item "Merge All Windows" of menu "Window" of menu bar 1
I don't want all windows to merge as tabs, juts the ones listed before the System Events block.
Is there something I need to tweak to make this work in Mojave (it worked previously in 10.13.6)?


Applescript:



tell application "Finder"
   close every window
   open "TamworthMacRAID:CUSTOMER - LIVE ARTWORK:"
   set the sidebar width of the front Finder window to 0
   tell application "Finder" to set the position of the front Finder window to {0, 147}
   open "TamworthMacRAID:CUSTOMER BRAND OVERVIEW:"
   set the sidebar width of the front Finder window to 0
   open "TamworthMacRAID:ARTWORK ESSENTIALS:ARTWORK LEGENDS:"
   set the sidebar width of the front Finder window to 0
   open "TamworthMacRAID:CUSTOMER STYLE GUIDES:"
   set the sidebar width of the front Finder window to 0
   
   tell application "System Events"
       
       tell process "Finder"
           
           click menu item "Merge All Windows" of menu "Window" of menu bar 1
           
           delay 1
           
           
       end tell
   end tell
   open ":Dave's Mac:Users:g-uk-tam1-retail-2:Desktop:PDF's:"
   set the sidebar width of the front Finder window to 0
   tell application "Finder" to set the position of the front Finder window to {3768, 768}
   
   open "TamworthMacRAID:TEMPORARY FILE TRANSFERS:"
   set the sidebar width of the front Finder window to 0
   tell application "Finder" to set the position of the front Finder window to {3167, 5}
   
   open "TamworthMacRAID:TEMPORARY FILE TRANSFERS:CURRENT JOB FOLDERS COPIED FROM SERVER:"
   set the sidebar width of the front Finder window to 0
   tell application "Finder" to set the position of the front Finder window to {3768, 13}
   
   open "TamworthMacRAID:TEMPORARY FILE TRANSFERS:RELEASES:"
   set the sidebar width of the front Finder window to 0
   tell application "Finder" to set the position of the front Finder window to {2567, 5}
   
   open "TamworthMacRAID:CUSTOMER ARTWORK PRINT GUIDELINES:"
   set the sidebar width of the front Finder window to 0
   tell application "Finder" to set the position of the front Finder window to {2000, 30}
   
end tell

Any pointer greatly appreciated

Regards

Dave

Offline

 

#2 2021-04-27 09:46:40 am

peavine
Member
From:: Prescott, Arizona
Registered: 2018-09-04
Posts: 871

Re: Merge All Windows of menu

TheBlackBinLiner. I found a number of issues with your script, and I rewrote it using folders often found on Macs (just for test purposes). If the script works OK, you can change the paths and position coordinates to those in your original script.

Applescript:

set homeFolder to (path to home folder as text)

tell application "Finder"
   activate
   close every window
   open folder (homeFolder & "Desktop:")
   set the sidebar width of the front Finder window to 0
   open folder (homeFolder & "Documents:")
   set the sidebar width of the front Finder window to 0
   set the position of the front Finder window to {50, 50}
end tell

delay 1 -- may not be necessary

tell application "System Events"
   tell process "Finder"
       set frontmost to true
       click menu item "Merge All Windows" of menu "Window" of menu bar 1
   end tell
end tell

delay 1 -- test different values

tell application "Finder"
   open folder (homeFolder & "Downloads:")
   set the sidebar width of the front Finder window to 0
   set the position of the front Finder window to {100, 100}
   open folder (homeFolder & "Pictures:")
   set the sidebar width of the front Finder window to 0
   set the position of the front Finder window to {150, 150}
end tell

Last edited by peavine (2021-04-27 07:17:13 pm)


2018 Mac mini - macOS Catalina

Offline

 

#3 2021-04-28 03:44:37 am

TheBlackBinLiner
Member
Registered: 2019-12-05
Posts: 27

Re: Merge All Windows of menu

Thanks so much for your solution.
It opened all the relevant folders but didn't merge the listed ones.
I've managed to tweak my original script using some of your info - the below now works as expected:

Applescript:



tell application "Finder"
   close every window
   open "TamworthMacRAID:CUSTOMER - LIVE ARTWORK:"
   set the sidebar width of the front Finder window to 0
   tell application "Finder" to set the position of the front Finder window to {0, 147}
   open "TamworthMacRAID:CUSTOMER BRAND OVERVIEW:"
   set the sidebar width of the front Finder window to 0
   open "TamworthMacRAID:ARTWORK ESSENTIALS:ARTWORK LEGENDS:"
   set the sidebar width of the front Finder window to 0
   open "TamworthMacRAID:CUSTOMER STYLE GUIDES:"
   set the sidebar width of the front Finder window to 0
   
   tell application "System Events"
       tell process "Finder"
           set frontmost to true
           click menu item "Merge All Windows" of menu "Window" of menu bar 1
       end tell
       
   end tell
   
   open ":Dave's Mac:Users:g-uk-tam1-retail-2:Desktop:PDF's:"
   set the sidebar width of the front Finder window to 0
   tell application "Finder" to set the position of the front Finder window to {3768, 768}
   
   open "TamworthMacRAID:TEMPORARY FILE TRANSFERS:"
   set the sidebar width of the front Finder window to 0
   tell application "Finder" to set the position of the front Finder window to {3167, 5}
   
   open "TamworthMacRAID:TEMPORARY FILE TRANSFERS:CURRENT JOB FOLDERS COPIED FROM SERVER:"
   set the sidebar width of the front Finder window to 0
   tell application "Finder" to set the position of the front Finder window to {3768, 13}
   
   open "TamworthMacRAID:TEMPORARY FILE TRANSFERS:RELEASES:"
   set the sidebar width of the front Finder window to 0
   tell application "Finder" to set the position of the front Finder window to {2567, 5}
   
   open "TamworthMacRAID:CUSTOMER ARTWORK PRINT GUIDELINES:"
   set the sidebar width of the front Finder window to 0
   tell application "Finder" to set the position of the front Finder window to {2000, 30}
   
   
end tell

Thanks again!

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)