Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get the URL of the frontmost tab from Chrome on OS X?

Is there a way to do this to Chrome?

tell application "Google Chrome"
 return URL of front document as string
end tell

... doesn't work.

like image 920
Daniel Avatar asked Mar 20 '10 12:03

Daniel


1 Answers

Now that Chrome (7+) supports AppleScript, you can do this:

tell application "Google Chrome"
    get URL of active tab of first window
end tell

Note: "first window" refers to the frontmost window.

like image 104
Guillaume Boudreau Avatar answered Nov 16 '22 04:11

Guillaume Boudreau