Skip to content

Instantly share code, notes, and snippets.

@zetavg
Last active October 11, 2022 10:02
Show Gist options
  • Save zetavg/27a9a613b71dc8bba2aa9d6fb9c6191a to your computer and use it in GitHub Desktop.
Save zetavg/27a9a613b71dc8bba2aa9d6fb9c6191a to your computer and use it in GitHub Desktop.
AppleScript to open a traditional new tab (with a New Tab page) in Arc browser. Bind this script to a shortcut key such as ⌘T or ⌘⇧T in tools like BetterTouchTool for Arc.
-- Can change this to your favorite new tab page extension URL, such as "chrome-extension://laookkfknpbbblfpciffpaejjkokdgca/dashboard.html"
set newTabPage to "chrome://new-tab-page/"
tell application "/Applications/Arc.app"
activate
-- tell front window to make new tab at after (get active tab) with properties {URL:"chrome://new-tab-page/"} -- not working
open location newTabPage
repeat
set windowTitle to ""
tell application "System Events"
set frontApp to first application process whose frontmost is true
set frontAppName to name of frontApp
set windowTitle to "no window"
tell process frontAppName
if exists (1st window whose value of attribute "AXMain" is true) then
tell (1st window whose value of attribute "AXMain" is true)
set windowTitle to value of attribute "AXTitle"
end tell
end if
end tell
end tell
if (windowTitle = "New Tab") then exit repeat
end repeat
tell application "System Events" to keystroke "o" using command down
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment