Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Firefox offer AppleScript support to get URL of windows?

I am trying to write an AppleScript that, among other things, gets the URL of every open webpage in Firefox.

In Safari (and Chrome), this is done very simply:

tell application "Safari" to return URL of every tab in every window

However, it seems to me that Firefox offers no real AppleScript support, such as for getting the URL of any tab or window. When I google the terms "Firefox" and "AppleScript" together, I mostly get Firefox bug requests asking for AppleScript support to be restored, last updated in 2010 or 2011 (like this and this).

Am I right in thinking, then, that Firefox no longer offers any proper AppleScript support? I realize that there are some semi-workarounds, such as simulating key-commands in AppleScript, but those aren't really practical for my purposes.

like image 859
ekl Avatar asked Jul 25 '13 00:07

ekl


Video Answer


2 Answers

To see all of the AppleScript commands that Firefox responds to, launch AppleScript Editor, select the menu File > Open Dictionary..., and choose the Firefox application.

You'll find what you're expecting: Firefox doesn't offer any useful AppleScript commands.

like image 191
John Sauer Avatar answered Dec 12 '22 05:12

John Sauer


Firefox 3.5 and earlier supported this, even though the command was not visible in the dictionary:

tell application "Firefox"
    get «class curl» of window 1
end tell

Firefox 3.6 removed this feature, and as of now (Firefox 22.0) it has not been restored.

like image 30
Michael Tsai Avatar answered Dec 12 '22 04:12

Michael Tsai