Skip to content

Instantly share code, notes, and snippets.

@eloypnd
Last active October 25, 2016 11:46
Show Gist options
  • Save eloypnd/49cfac96ca65fa3a3d8ce9b0d042540c to your computer and use it in GitHub Desktop.
Save eloypnd/49cfac96ca65fa3a3d8ce9b0d042540c to your computer and use it in GitHub Desktop.
useful AppleScripts
(* Copy all open tabs from the Google Chrome windows that have focus
*
* version: 0.1
* author: Eloy Pineda <[email protected]>
* license: MIT
*)
set urlList to {}
tell application "Google Chrome"
activate
set chromeWindow to front window
repeat with w in chromeWindow
try
repeat with t in (tabs of w)
set tabTitle to (title of t)
set tabUrl to (URL of t)
set tabLine to ("- [" & tabTitle & "](" & tabUrl & ")")
copy tabLine to the end of urlList
end repeat
end try
end repeat
end tell
set text item delimiters to linefeed
set the clipboard to urlList as text
return urlList as text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment