Skip to content

Instantly share code, notes, and snippets.

@sousk
Created August 13, 2009 06:43
Show Gist options
  • Save sousk/167024 to your computer and use it in GitHub Desktop.
Save sousk/167024 to your computer and use it in GitHub Desktop.
reload firefox v3.5
ps -xc|grep -sqi firefox && osascript <<'APPLESCRIPT'
tell application "Firefox" to activate
tell application "System Events"
if UI elements enabled then
keystroke "r" using command down
-- Fails if System Preferences > Universal access > "Enable access for assistive devices" is not on
else
-- Fails if Firefox is set to open URLs from external apps in new tabs.
-- tell app "Firefox" to Get URL "JavaScript:window.location.reload();" inside window 1
tell application "Firefox" to get URL "JavaScript:window.location.reload();"
end if
end tell
APPLESCRIPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment