Skip to content

Instantly share code, notes, and snippets.

@42point
Forked from chmurph2/copyURLPlusSafari.scpt
Last active October 28, 2017 22:01
Show Gist options
  • Select an option

  • Save 42point/594e728fad23353eaaee774b33cc21a7 to your computer and use it in GitHub Desktop.

Select an option

Save 42point/594e728fad23353eaaee774b33cc21a7 to your computer and use it in GitHub Desktop.
In Safari, this applescript copies the title and URL of the current tab to the clipboard in Markdown format
-- In Safari, this copies the Title and URL of the current tab to the clipboard.
-- Save the script in ~/Library/Scripts/Applications/Safari
-- Using Alfred, I assign a trigger to this script using the hotkey ⌥-C (option c), with the scope of the trigger limited to Safari.
-- Inspired by CopyURL + (http://copyurlplus.mozdev.org/)
-- Inspired by Christopher R. Murphy
-- Modified by Lexx
tell application "Safari"
set theURL to URL of front document
set theTitle to name of front document
set the clipboard to "[" & theTitle & "]" & "(" & theURL & ")" as string
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment