Last active
August 29, 2015 14:06
-
-
Save bachya/ef93d306c5f6221d2c01 to your computer and use it in GitHub Desktop.
For use in TextExpander or aText. Grabs the current tab in Safari and returns a Markdown link with the current title and URL.
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
-- Before we do anything, see if there's even an instance | |
-- of Safari running. | |
tell application "System Events" | |
set numSafari to count (every process whose name is "Safari") | |
end tell | |
if numSafari > 0 then | |
tell application "Safari" | |
set currentTab to current tab of front window | |
set theUrl to URL of currentTab | |
set theTitle to name of currentTab | |
end tell | |
end if | |
get "[" & theTitle & "](" & theUrl & ")" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment