Created
July 16, 2014 23:43
-
-
Save fabiofortkamp/d6b937bdcac186a216e4 to your computer and use it in GitHub Desktop.
AppleScript to show a list of Safari tab URLS, to be used with TextExpander, but it crashes
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 "System Events" | |
set numSafari to count (every process whose name is "Safari") | |
end tell | |
if numSafari > 0 then | |
tell application "Safari" | |
set URLList to {} | |
set windowCount to number of windows | |
repeat with win from 1 to windowCount | |
set tabCount to number of tabs in window win | |
repeat with thisTab from 1 to tabCount | |
set tabURL to URL of tab thisTab of window win | |
set the end of URLList to tabURL | |
end repeat | |
end repeat | |
set chosenURL to choose from list URLList | |
end tell | |
get "[%|](" & chosenURL & ")" | |
end if |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment