Last active
December 13, 2016 22:52
-
-
Save miklb/7453703 to your computer and use it in GitHub Desktop.
Simple pair of TextExpander snippets to grab the frontmost URL in Safari, copy it to the clipboard then make a markdown link from it. I needed this because I use a Popclip extension that allows me to copy selected text from a page and make a new note in nvAlt. Doing so takes me away from the browser, and I wanted a quick and handy way to create …
This file contains hidden or 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
## Again, note the snippet abbreviation from the safari_link_clipboard snippet | |
## This should be a default plain text snippet | |
%snippet:slink#% | |
[%filltext:name=Title%](%clipboard%) |
This file contains hidden or 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
## What ever you abbreviate this snippet as, you will need to reference in the markdown_link snippet. I used slink# | |
## Make sure to set the type of snippet to Applescript, TE defaults to plain text | |
tell application "Safari" | |
set theURL to URL of front document | |
set the clipboard to theURL as string | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note you will probably never directly call safari_link_snippet, but it needs an abbreviation to be used in other snippets, which could be handy in a variety of uses.