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
Here's the code for Chrome:
tell application "Google Chrome"
tell the active tab of its first window
reload
end tell
end tell
Or more concisely:
tell application "Google Chrome" to tell the active tab of its first window
reload
end tell
Here's another way to do it in Safari without using JavaScript:
tell application "Safari"
tell its first document
set its URL to (get its URL)
end tell
end tell
tell application "Google Chrome" to tell the active tab of its first window
reload
end tell
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