Skip to content

Instantly share code, notes, and snippets.

@msoap
Last active May 19, 2020 07:45
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 msoap/679dec0397b63d12bfd94539ef51e4dd to your computer and use it in GitHub Desktop.
Save msoap/679dec0397b63d12bfd94539ef51e4dd to your computer and use it in GitHub Desktop.
get Safari all tabs urls and titles
#!/bin/sh
osascript<<APPLESCRIPT 2>&1
-- get Safari all tabs urls and titles
-- safari-get-all-tabs-urls.sh | less
tell application "Safari"
set tabsList to front window's tabs as list
repeat with currTab in tabsList
set currName to currTab's name
set currURL to currTab's URL
set out to currURL & " - " & currName
log out
end repeat
end tell
APPLESCRIPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment