I was trying to find a Firefox equivalent to the script in the link above under the line "Safari's Reload button", which monitors particular properties of Safari's Reload button. Therefore, I tried to write my own script for Firefox:

tell application "Firefox"
end tell

tell ¬
    application "System Events" to tell ¬
    process "Firefox" to tell ¬
    window 1 to tell ¬
    toolbar 2 to tell ¬
    groups to tell ¬
    UI element 1 to ¬
    set reload_button to a reference to ¬
        (first button whose name is "Reload current page")

using terms from application "System Events"
    repeat until the accessibility description ¬
        of the reload_button ¬
        contains "Reload current page"
    end repeat
end using terms from

log "Finished loading"

However, my script fails at "tell window 1". I guess many parts of the script do not work for Firefox. How should I modify the script?

  • 1
    Firefox is a black box to basic vanilla AppleScript and doesn't even have an AppleScript dictionary, i.e., no Firefox.sdef file within its application bundle. The only UI element exposed are the three stop light buttons in the upper left corner of a window. – user3439894 May 28 '19 at 18:16
  • At one time, you could inject javascript into firefox. – historystamp May 28 '19 at 20:04
  • What are you trying to accomplish? With more info, perhaps we could suggest a different approach. – historystamp May 28 '19 at 20:05
  • Thank you for letting me know that Firefox doesn't quite work with AppleScript. There is an online activity that I want to sign up for every month. The website is so busy that it always takes Firefox more than 1 min to load. With other browsers like Safari or Chrome, it's even almost impossible to connect to the website (Error 504). Looks like Firefox has its way to keep connecting (?) without bumping into Error 504. If I can make Safari load the website successfully, I will switch to Safari and write an AppleScript for it to wait for the page loading before submitting the form. – isend May 28 '19 at 20:42
  • I think I will try bookmarklet instead for Firefox. Thanks for suggestions. – isend May 29 '19 at 2:11

You must log in to answer this question.

Browse other questions tagged .