Skip to content

Instantly share code, notes, and snippets.

@jamesmartin
Created September 1, 2009 01:40
Show Gist options
  • Save jamesmartin/178829 to your computer and use it in GitHub Desktop.
Save jamesmartin/178829 to your computer and use it in GitHub Desktop.
# AppleScript to reset safari.
# Originally found at http://macscripter.net/viewtopic.php?id=30178&action=new
tell application "Safari" to set ResetSafari_loc to localized string "Reset Safari…"
if ResetSafari_loc ends with "…" then
set ResetSafari_loc to text 1 thru -2 of ResetSafari_loc
else if ResetSafari_loc ends with "..." then
set ResetSafari_loc to text 1 thru -4 of ResetSafari_loc
end if
activate application "Safari"
tell application "System Events" to tell process "Safari"
tell menu bar 1
tell menu bar item "Safari" to tell menu 1 (* EDITED *)
-- get name of every menu item
click menu item 9
end tell
end tell
repeat until exists window ResetSafari_loc
delay 0.2
end repeat
tell window ResetSafari_loc
click button 1
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment