Created
November 25, 2022 09:00
-
-
Save zetavg/06da03ebfe394fd1730398feb5271051 to your computer and use it in GitHub Desktop.
Bind this script to a hot key that runs if the active app is Arc. (e.g. BTT)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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