I built a **[widget][1]** that grabs the URL from the frontmost window in Safari, then allows you to shorten it using the tr.im API. Works sweet as.

I want to make this more flexible, so am investigating how to grab an URL from other browsers. Here's the AppleScript that works in Safari:

```
tell application "Safari"
    return URL of front document as string
end tell

```

After [some digging](https://web.archive.org/web/20141112082406/http://hintsforums.macworld.com/showthread.php?t=32237), I determined that the following *might* work for Firefox (though one person has told me it doesn't work for him, possibly a conflict with some extension?):

```
tell application "Firefox"
    set myFirefox to properties of front window as list
    return item 3 of myFirefox
end tell

```

*Note: The above is an example of a less-than-best practice, relying on the position of list items. See below for a better solution for Firefox.*

What I'd like to do is build a list here of the definitive equivalents for every modern browser on the Mac: Opera, Camino, Flock, etc.

**Update:** In my research on the subject, I came across a helpful thread on [MacOSXHints.com](http://www.macosxhints.com/article.php?story=20060325015454467). Most of my answers below are based on that discussion.

**Update 2:** I've incorporated the AppleScript on this page into the [widget][1]. It seems to be working swell.