Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tgambee/e8c0ffe8a0f39e83a6425c548d91cbc7 to your computer and use it in GitHub Desktop.
Save tgambee/e8c0ffe8a0f39e83a6425c548d91cbc7 to your computer and use it in GitHub Desktop.
set appName to "Google Chrome"
if application appName is running then
tell application "Google Chrome" to activate
delay .5
tell application "System Events" to ¬
keystroke "n" using ¬
{shift down, command down}
delay .5
tell application "Google Chrome"
set myTab to make new tab at end of tabs of window 1
set URL of myTab to the clipboard
end tell
else
do shell script "open -a /Applications/Google\\ Chrome.app --args --incognito"
delay .5
tell application "Google Chrome" to activate
delay .5
tell application "Google Chrome"
set myTab to make new tab at end of tabs of window 1
set URL of myTab to the clipboard
end tell
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment