Last active
October 25, 2016 11:46
-
-
Save eloypnd/49cfac96ca65fa3a3d8ce9b0d042540c to your computer and use it in GitHub Desktop.
useful AppleScripts
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
(* 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