Search code examples
macosfirefoxgoogle-chromeapplescript

Mac: reloading document in Chrome or Firefox?


How can I tell Chrome or Firefox to reload the document in the top window? Here's what I'm using for Safari:

osascript -e '
    tell application "Safari"
      activate
      do JavaScript "history.go(0)" in document 1
    end tell
'

Solution

  • I do not think Firefox or Chrome have special Applescript support, but you can send the keystrokes (Cmd-R) to refresh the page:

    tell application "Firefox"
        activate
        tell application "System Events" to keystroke "r" using command down
    end tell