GUI Safari Bookmarks

I’ve found another thread on the forums based on JavaScript to do this, but I actually need this script to load the bookmarks based upon having them in the tabs. I.E, going to them in them in the Bookmarks Bar and clicking on “Open in Tabs” instead. I’ve been trying for ages, yet just constantly get an error. Can anyone explain how I’m able to navigate toward it?


set app_name to "Safari"
set menu_name to "Bookmarks"
set menu_item to "Bookmarks Bar"
set submenu_item to "Open in Tabs"

tell application app_name
	activate
end tell
tell application "System Events"
	tell process app_name
		tell menu bar 1
			tell menu bar item menu_name
				tell menu menu_name
					tell menu item menu_item
						tell menu menu_item
							click menu item submenu_item
						end tell
					end tell
				end tell
			end tell
		end tell
	end tell
end tell

Thanks for any help

Hi,

I get this:

tell application “Safari” to activate
tell application “System Events”
tell process “Safari”
tell menu bar 1
tell menu “Bookmarks”
tell menu item “Bookmarks Bar”
tell menu 1
click menu item “Open in Tabs”
end tell
end tell
end tell
end tell
end tell
end tell

gl,

Thanks ever so much