Created
July 8, 2016 15:42
-
-
Save pedrofurla/d7b58d02992dfac3e72da5760abfe3f3 to your computer and use it in GitHub Desktop.
Bash/AppleScripts to open or reload chrome
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
open /Applications/Google\ Chrome.app --args --allow-file-access-from-files --unlimited-quota-for-files |
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
osascript -e 'tell application "Google Chrome" to tell the active tab of its first window to reload' |
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
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 |
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
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