Last active
January 4, 2016 18:44
-
-
Save aviflax/914cb5c1494a24a7cf98 to your computer and use it in GitHub Desktop.
Applescript to List all Tabs in Front Safari Window
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
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