Get Current Window URL from Chrome or Safari

Is there an action for getting the current URL of a window in Google Chrome or Safari and putting it to a clipboard?

I can do this with AppleScript of course as an action.

tell application "Google Chrome" to return URL of active tab of front window

tell application "Safari" to return URL of front document

Sure, just use the tokens %ChromeURL% and %SafariURL% in a Set Clipboard to text:

There is a set of tokens for both Chrome and Safari that you might want to explore:

Also, if you search the Keyboard Maestro Wiki for "Chrome" (or "Safari") you will find a number of hits for both tokens and actions:

1 Like

Very nice thank you, I was searching through the action list for URL, looked through all the google chrome actions, and searched everything in the menus with a typed search. I figured I was looking in the wrong place. I’ll have to make a note that there are many more variables that Keyboard Maestro can do that aren’t searchable within Keyboard Maestro.

Thanks for this!
%ChromeURL%
https://wiki.keyboardmaestro.com/token/ChromeURL

You will enjoy the next version then, it adds searching of the wiki to the Help menu:

5 Likes

Wow! Peter, I didn't know that you could read my mind, and implement new features so quickly! I was just thinking how cool and helpful that would be.

1 Like

That is awesome and will be so helpful, I am very much looking forward to what you have in store for us next!