Jump to content

URL, Page Title and Selected Text Copy and Paste


Recommended Posts

The workflow takes the url of the active safari tab, and copies it to the clipboard.

If you want it also throws the the page title in there. 

If you have selected some text, it tries to recognize that and takes that instead of the page title. 

It also can directly paste that whole string.

 

That's it. Tremendously helpful for IM conversations or as a starting point for a Tweet.

 

I have bound it like this

 

  • CMD Option U to copy URL
  • CMD Option Shift U to paste URL
  • CMD Option K to copy Page Title and URL
  • CMD Option Shift K to paste Page Title/Selected Text and URL

 

Originally created by Michael Matochkin, I adapted the workflow over time and now publish it here. Original credits in the readme: Based on Alfred extensions by Luca Soldaini (original applescript by Dr. Drang) and Zibity

 

I've used an icon from the Stylistica Icon Set

 

That should cover it. And of course: here is the UPDATED workflow download link (see my latest comment for more info)

 

Cheers!

Timm

Edited by tschoof
Link to comment
  • 3 weeks later...

Thanks.  I've tweaked the title/URL scripts to produce Markdown links instead -- replace the first tell block in each with

tell application "Safari"
	set theURL to URL of front document
	set theTitle to name of front document
	set selectedText to (do JavaScript "(''+getSelection())" in document 1)
	set myCount to count (selectedText)
	if myCount is greater than 0 then
		set the clipboard to "\"[" & selectedText & "\"]" & "(" & theURL as string & ")"
	else
		set the clipboard to "[" & theTitle & "](" & theURL as string & ")"
	end if
end tell
Link to comment
  • 1 month later...
  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...