Skip to content

Instantly share code, notes, and snippets.

@nkryptic
Forked from dblandin/activate_tab.applescript
Last active May 17, 2016 14:02
Show Gist options
  • Save nkryptic/11304376 to your computer and use it in GitHub Desktop.
Save nkryptic/11304376 to your computer and use it in GitHub Desktop.
# Activate tab
# $ osascript set_tab.scpt 1, 2
on run argv
set window_index to item 1 in argv
set target_index to item 2 in argv
tell application "Google Chrome" to set active tab index of first window to target_index
tell application "Google Chrome" to activate
end run
# Search tabs
set urlString to ""
tell application "Google Chrome"
set window_list to every window # get the windows
repeat with the_window in window_list # for every window
set tab_list to every tab in the_window # get the tabs
repeat with the_tab in tab_list # for every tab
set the_url to the URL of the_tab # grab the url
set urlString to urlString & the_url & "\n" # concatenate them all
end repeat
end repeat
end tell
return urlString
https://gist.github.com/
http://www.google.com/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment