Skip to content

Instantly share code, notes, and snippets.

@aviflax
Last active January 4, 2016 18:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aviflax/914cb5c1494a24a7cf98 to your computer and use it in GitHub Desktop.
Save aviflax/914cb5c1494a24a7cf98 to your computer and use it in GitHub Desktop.
Applescript to List all Tabs in Front Safari Window
tell application "Safari"
set docText to ""
set tabcount to number of tabs in front window
repeat with y from 1 to tabcount
set tabName to name of tab y of front window
set tabURL to URL of tab y of front window
set tabText to tabName & linefeed & tabURL
set docText to docText & tabText & linefeed & linefeed as string
end repeat
end tell
tell application "TextEdit"
activate
make new document
set the text of the front document to docText
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment