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)?



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

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.

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

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:



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!