Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
osascript to open a new chrome window + url
- Loading branch information
1 parent
f38f42f
commit 2368655
Showing
1 changed file
with
13 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
if [[ -x '/Applications/Google Chrome.app' || -x "$HOME/Applications/Google Chrome.app" ]]; then | ||
# Taken from http://apple.stackexchange.com/questions/9500/how-to-make-chrome-open-a-new-window-for-external-links and modified | ||
function chromew { | ||
URL=$1 | ||
osascript -e 'on run argv | ||
tell application "Google Chrome" | ||
make new window | ||
activate | ||
set URL of active tab of first window to item 1 of argv | ||
end tell | ||
end run' $URL | ||
} | ||
fi |