Skip to content

Instantly share code, notes, and snippets.

@pedrofurla
Created July 8, 2016 15:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pedrofurla/d7b58d02992dfac3e72da5760abfe3f3 to your computer and use it in GitHub Desktop.
Save pedrofurla/d7b58d02992dfac3e72da5760abfe3f3 to your computer and use it in GitHub Desktop.
Bash/AppleScripts to open or reload chrome
open /Applications/Google\ Chrome.app --args --allow-file-access-from-files --unlimited-quota-for-files
osascript -e 'tell application "Google Chrome" to tell the active tab of its first window to reload'
osascript <<END
set u to "$1"
tell application "Google Chrome"
repeat with w in windows
set i to 0
repeat with t in tabs of w
set i to i + 1
if NAME of t is u then
set active tab index of w to i
set index of w to 1
tell t to reload
--activate
return
end if
end repeat
end repeat
-- open location u
-- activate
end tell
END
osascript <<END
set u to "$1"
tell application "Google Chrome"
repeat with w in windows
set i to 0
repeat with t in tabs of w
set i to i + 1
if URL of t is u then
set active tab index of w to i
set index of w to 1
tell t to reload
--activate
return
end if
end repeat
end repeat
open location u
--activate
end tell
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment