Chrome Second Window

Hi folks.

Anybody know how to get the URL of a background window in Chrome? I can get the front window URL, but I need the URL of the other window. Not sure how to reference that.

Cheers

Hi, you can get a list of every tab’s URL by telling a window to “get URL of every tab”.

This will return the URL of the active tab of window 2

tell application "Google Chrome"
	tell its window 2 to set theURL to URL of active tab
end tell

This will return the URLs of the active tabs of every window

tell application "Google Chrome"
	set windowsRef to a reference to windows
	set theURLs to URL of active tab of windowsRef
end tell

error “Google Chrome got an error: Can’t get every tab.” number -1728 from every tab

Excellent.

Sorry for the delayed reply. I’m not being notified of any replies to my question. This site needs fixing.

Cheers