Skip to content

Instantly share code, notes, and snippets.

@bachya
Created July 23, 2014 16:34
Show Gist options
  • Save bachya/694ff8a774f805882218 to your computer and use it in GitHub Desktop.
Save bachya/694ff8a774f805882218 to your computer and use it in GitHub Desktop.
Updated Markdown Links in TextExpander
tell application "System Events"
set numSafari to count (every process whose name is "Safari")
set numChrome to count (every process whose name is "Google Chrome")
end tell
if numSafari > 0 then
tell application "Safari"
set fURL to URL of front document
set fTitle to name of front document
end tell
else
if numChrome > 0 then
tell application "Google Chrome"
set frontIndex to active tab index of front window
set fURL to URL of tab frontIndex of front window
set fTitle to title of tab frontIndex of front window
end tell
end if
end if
get "[" & fTitle & "](" & fURL & ")"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment