Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. (* Copy all open tabs from the Google Chrome windows that have focus
  2. *
  3. * version: 0.1
  4. * author: Eloy Pineda <me@eloy.codes>
  5. * license: MIT
  6. *)
  7.  
  8. set urlList to {}
  9. tell application "Google Chrome"
  10. activate
  11. set chromeWindow to front window
  12. repeat with w in chromeWindow
  13. try
  14. repeat with t in (tabs of w)
  15. set tabTitle to (title of t)
  16. set tabUrl to (URL of t)
  17. set tabLine to ("- [" & tabTitle & "](" & tabUrl & ")")
  18. copy tabLine to the end of urlList
  19. end repeat
  20. end try
  21. end repeat
  22. end tell
  23.  
  24. set text item delimiters to linefeed
  25. set the clipboard to urlList as text
  26. return urlList as text
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement