Copy a page title and URL from Chrome and paste as a hyperlink in Gmail

I regularly need to insert links to specific articles from a support library into Gmail.

I need to collect the title of the article and the page URL, then paste them into Gmail as a hyperlink.

Can anyone point me in the right direction?

It seems like it should be simple! I have messed around with Alfred and BetterTouchTool but can’t figure out a complete solution.


I created some Shortcuts for you that use apple script to get the Title and url of your current Google Chrome tab and then converts them into a hyperlink using Markdown and copies it to your clipboard as rich text.

This Shortcut Allows you to edit the title of the tab before creating the Hyperlink

Creates the Hyperlink with whatever title the tab already has

You can assign these keyboard shortcuts to these Shortcuts either within the Shortcuts app, BetterTouchTool, or Alfred.

I personally assign all my keyboard shortcuts using BetterTouchTool when possible.

Let me know if you have any questions.

Hope this helps :slight_smile:


This short cut may help: Shortcuts

I also created this AppleScript:

tell application "Safari"
	set windowName to name of window 1
	set windowURL to URL of document 1
end tell

set the clipboard to "[" & windowName & "](" & windowURL & ")"

I wouldn’t use TextExpander for this one, I’d use Keyboard Maestro instead because you can set a trigger for when it is run. I also made the final output into a markdown link for easier posting as a link.

I am glad you like the Shortcut I wrote :slight_smile:

Thanks so much, @AidanMJ25!

When I try to paste the link, Gmail says “Error: This file is 0 bytes, so it will not be attached.”

But this has given me a great starting point. Obviously Apple Script is the next thing I really need to learn about!

Thanks, @bocciaman, I appreciate the help!

No problem :slight_smile:

That’s weird, I assume you are using just plain stock gmail in the browser?

How are you triggering the Shortcut?

Which Shortcut did you use when you got that error?

Can you send the link to the page you tried it on? Hopefully then I can troubleshoot it better.

I have tried all three shortcuts on this page.

I have tried triggering them from Shortcuts itself, and from Alfred.

In the Alfred clipboard viewer, I can see the link that has been generated, so I wonder it’s some kind of conflict or permissions issue… :thinking: