Last active
October 6, 2019 21:09
-
-
Save bacalj/c027e27eb2d86caf7a38f2753fc615df to your computer and use it in GitHub Desktop.
open chrome tabs with JXA
This file contains hidden or 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
| /* create chrome instance */ | |
| chrome = Application("Google Chrome"); | |
| chrome.includeStandardAdditions = true; | |
| /* make a new window and set its first tab */ | |
| win = chrome.Window().make(); | |
| win.tabs[0].url = "http://www.google.com"; | |
| /* make a new tab and push it into window we made */ | |
| tab = win.tabs.push(new chrome.Tab()); | |
| win.tabs[1].url = "http://www.apple.com"; | |
| /* destroy the extra window created originally on app opening */ | |
| chrome.windows.byId(1).close(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment