Okay – found an Applescript way for whoever is interested:
set bookmarksFolder to "Q9"
tell application "Safari" to activate
delay 1
tell application "System Events" to ¬
click menu item "Open in New Tabs" of ¬
menu 1 of ¬
menu item bookmarksFolder of ¬
menu 1 of ¬
menu bar item "Bookmarks" of ¬
menu bar 1 of ¬
application process "Safari"
Out of curiosity wonder if there is a native Keyboard Maestro way to do so.
No – in that Keyboard Maestro has no Safari-specific functions to do any of that – they are all AppleScript under-the-hood anyway.
Here's a way to open a toolbar button for type-select.
--------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2021/11/15 14:42
# dMod: 2021/11/15 14:42
# Appl: Safari, System Events
# Task: Open a Toolbar Menu To Make Type-Select Available.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @Safari, @System_Events, @Open, @Toolbar, @Menu, @Type-Select
# Test: Tested on macOS 10.14.6 Mojave with Safari 14.1.2 (14611.3.10.1.5).
# Vers: 1.00
--------------------------------------------------------
ignoring application responses
tell application "System Events"
tell application process "Safari"
set its frontmost to true
tell (first window whose subrole is "AXStandardWindow")
tell group 2
tell menu button "QK"
perform action "AXShowMenu"
end tell
end tell
end tell
end tell
end tell
end ignoring
--------------------------------------------------------
I also regularly make use of a "front-browser" macro that opens the bookmark menu for type-select and selects the first menu starting with the letter “A” – in my case for “Admin”.
@ccstone, wondering in Applescript how does one define a sub folder? I.e. if I have a folder name Quest in the favorites bookmark folder how do I refer to this in Applescript?
--------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2021/11/16 08:18
# dMod: 2021/11/16 08:18
# Appl: Safari, System Events
# Task: Select Third Tier Menu in The Bookmarks Menu.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @Safari, @System_Events, @Select, @Bookmarks, @Menu
--------------------------------------------------------
tell application "System Events"
tell application process "Safari"
set frontmost to true
tell menu bar 1
tell menu bar item "Bookmarks"
perform action "AXPress"
tell menu 1
tell menu item "a_Admin"
perform action "AXPress"
tell menu 1
tell menu item "Login"
perform action "AXPress"
end tell
end tell
end tell
end tell
end tell
end tell
end tell
end tell
--------------------------------------------------------