Apple - How can I copy a Google search URL from Safari?

Like suggested elsewhere, you can drag the search text from the URL bar into some plain text view. However, one can also directly drag it into a (rich text) email or chat message. Or into Google's search field which is conveniently close to Safari's location bar:

Dragging search terms into search field

(In previous versions, you could drag the magnifying glass icon; in 2016 versions just drag the search text like shown above.)

After dragging into Google's search field, the additional search text is already selected and focussed, ready for Command+C:

After dragging

(In earlier versions, Safari's location bar will still have focus, and the URL in Google's search input will be gray, not blue. In those versions one could first hit Tab after searching to go into Google's search field, hit Delete to clear it, and then drag the icon. After that, the search field is ready for Command+C as well.)

The Share button to the right of the location bar can also share the URL, but probably only when messaging has been configured:

Safari 6 in Mountain Lion Share button

As an aside: the Google URLs include a lot of irrelevant things, specific to your browser, language, etc. Often, it's enough to use www.google.com#q=elvis+is+alive, or for image search www.google.com#tbm=isch&q=elvis+is+alive, but then one needs to change the spaces into plus-characters to ensure it's clickable. (And one also needs to percent-encode other special characters.) It would be nice if Google would provide some bare sharing link on its own site.


It's not a very elegant solution, but you can make a bookmarklet that will open a pop-up dialog with a copiable version of the URL.

To do this, bookmark any page you happen to have handy, then open the Bookmarks manager (Bookmarks > Show All Bookmarks), and edit the address of that bookmark to be javascript:alert(location.href);. Change the name to whatever you want.

Then when you click it, you should get a popup that looks like this: example popup


You could also drag the favicon to a plain text view.

Or assign a shortcut to a script like this:

tell application "Safari" to URL of document 1
set the clipboard to result

Tags:

Safari