Skip to content

Instantly share code, notes, and snippets.

@samyk
Created June 14, 2016 18:36
Show Gist options
  • Star 20 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • Save samyk/65c12468686707b388ec43710430a421 to your computer and use it in GitHub Desktop.
Save samyk/65c12468686707b388ec43710430a421 to your computer and use it in GitHub Desktop.
applescript to show all url+titles of Chrome tabs along with front window+tab url+title
# shows all url+titles of Chrome along with front window+tab url+title
set titleString 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 the_title to the title of the_tab # grab the title
set titleString to titleString & the_url & " - " & the_title & "\n" # concatenate
end repeat
end repeat
set the_url to the URL of active tab of front window # grab the URL
set the_title to the URL of active tab of front window # grab the title
set titleString to titleString & "Active: " & the_url & " - " & the_title & "\n" # concatenate
end tell
@NoahCardoza
Copy link

Thanks!
I wanted to run this code on a variable browser so I adapted this a little.

If anyone else has this problem check out: getOpenTabs.sh

@avatar70t
Copy link

The "URL" in the line 18 should be replaced with "title."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment