MacMost Q&A Forum • View All Forum QuestionsAsk a Question

How Do I Copy Active Safari Tab’s URL To Clipboard Using Shortcuts App On Mac?

I watched your recent YouTube video on using Shortcuts app to copy text on the screen and it works great. Thanks for that.

I wanted to set up a keyboard shortcut, ⌘ + u to copy the URL of the active Safari tab in Mac.

Added a Shortcut like this: https://cln.sh/AkySMA. It works when I press the Play button and shows the URL.

But when I switch to Safari and press the designated keyboard shortcut, nothing gets copied in the clipboard.

This would be a great YouTube video for you to share to your viewers if you can get this working.
—–
Sridhar Katakam

Comments: 4 Responses to “How Do I Copy Active Safari Tab’s URL To Clipboard Using Shortcuts App On Mac?”

    1 year ago

    So a URL is a special value. But the clipboard you want is plain text. To convert a URL to plain text, you can do it with a "Text" action. Add that after "Get current URL from Safari." In the Text action, insert a Magic Variable and select the URL coming out of Get current URL from Safari. This creates a piece of text with the converted URL in it. Then put the Copy to Clipboard after the Text so it is "Copy Text to clipboard." That will work.

    Also, you can set the input to "Receive NO input from Quick Actions" because you aren't using the Quick Action input. Instead, you are just taking the value from "Get Current URL from Safari."

    Sridhar Katakam
    1 year ago

    Thanks so much Gary.

    That led me in the right direction.

    This is working: https://d.pr/i/Oo8Exv

    1 year ago

    Sridhar Katakam: Get Text From. That works even better. 👍

    Razvan
    5 months ago

    Sridhar: thanks for bringing this up. Gary: Thanks for the tip. I have managed to get this to work as suggested. I have assigned the Control-Command-L shortcut as the Command-L takes you to the URL without copying it. The shortcut seems to work in most cases except those in which the web page requires keyboard input, for example, this webpage where I type in my comments now. I have been searching for a way to override input mode. The default Command-L seems to work regardless.

Comments Closed.