Skip to content

Instantly share code, notes, and snippets.

@chmurph2
Created February 26, 2009 01:12
Show Gist options
  • Star 23 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save chmurph2/70565 to your computer and use it in GitHub Desktop.
Save chmurph2/70565 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 Safari, this copies the Title and URL of the current tab to the clipboard.
-- Save the script in ~/Library/Scripts/Applications/Safari
-- Using QuickSilver, 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/)
-- Christopher R. Murphy
tell application "Safari"
set theURL to URL of front document
set theTitle to name of front document
set the clipboard to theTitle & return & theURL as string
end tell
@Zeokat
Copy link

Zeokat commented Mar 7, 2014

You saved Zeokat day, very usefull. Thanks.

@woodybrood
Copy link

Very nice.

@andrewpmiller
Copy link

Perfect - thanks!

@onproton
Copy link

Awesome, thanks!

@artembeloglazov
Copy link

It doesn't work with example.com#SOME_TEXT . How i can assign to a variable theURL full URL with "#SOME_TEXT"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment