Copy URLS for all tabs in current Chrome window?

I'd like to have a macro that copies the URLs of all the tabs open in the currently front Chrome window.

So, for example, let's say I have a Chrome window open with three tabs in the following order: Wired, ESPN, and CNN. Triggering this macro would copy the following to my system clipboard, each on its own line...

https://www.wired.com/
https://www.espn.com/
https://www.cnn.com/

Any help would be greatly appreciated!

I don't have Chrome, but I decided to take up your challenge and do this for Safari. It seems to work fine, and you shouldn't have much problem modifying it to work with Chrome. I see one function call, one token, and one action that you will have to change.

There are probably other ways to solve this, including AppleScript, but this seems to be a simple way to do it.

Group Action (v11.0.1)

Group.kmactions (2.0 KB)

Keyboard Maestro Export

I'm not sure what this macro will do if you have multiple Chrome windows open. I guess you can try it and see.

1 Like

Here’s an alternative method if you want to go the AppleScript route.

Download Macro(s): Get URLs of every tab of front Google Chrome window.kmmacros (2.5 KB)

AppleScript (click to expand/collapse)
tell application "Google Chrome" to tell window 1 to set theURLs to URL of every tab
set {TID, text item delimiters} to {text item delimiters, ", "}
set theURLs to text items of theURLs
set text item delimiters to return
set theURLs to theURLs as text
set text item delimiters to TID
return theURLs
Macro-Image (click to expand/collapse)

Macro-Notes (click to expand/collapse)
  • Macros are always disabled when imported into the Keyboard Maestro Editor.
  • The user must ensure the macro is enabled.
  • The user must also ensure the macro's parent macro-group is enabled.
System Information (click to expand/collapse)
  • macOS 13.6
  • Keyboard Maestro v11.0.1
1 Like

@Airy and @cdthomer, thank you guys both, as always. :pray:t3::pray:t3:

1 Like