Hi all,
Due to some issues with ezproxy, I find that I am constantly needing to clear cookies in Safari 4 Public Beta. Naturally I would like to script this and bind it to a shortcut somehow (as an aside, it seems I am unable to do this without a third-party utility). The code is as follows:
activate application "Safari"
--------
activate application "Safari"
tell application "System Events"
tell process "Safari"
--Open Safari -> Preferences
click menu item "Preferences " of menu 1 of menu bar item "Safari" of menu bar 1
--Open Security Tab
click button "Security" of tool bar 1 of window 1
--Show Cookies Button in Security Tab
click button "Show Cookies" of group 1 of group 1 of window "Security"
--Remove All in the Security:Show Cookies sheet
click button "Remove All" of sheet 1 of window "Security"
--Click "Remove All" in the pop-up confirmation dialog
click button "Remove All" of window 1
--Done with the Security:Show Cookies sheet
click button "Done" of sheet 1 of window 1
--Done with the Security Tab
click button 1 of window "Security"
end tell
end tell
--------
The issue is that at some point after the confirmation dialog comes up (click button "Remove All" of sheet 1 of window "Security") the script freezes for a couple of seconds. This behavior does not occur when manually activating the buttons. Any ideas?
Due to some issues with ezproxy, I find that I am constantly needing to clear cookies in Safari 4 Public Beta. Naturally I would like to script this and bind it to a shortcut somehow (as an aside, it seems I am unable to do this without a third-party utility). The code is as follows:
activate application "Safari"
--------
activate application "Safari"
tell application "System Events"
tell process "Safari"
--Open Safari -> Preferences
click menu item "Preferences " of menu 1 of menu bar item "Safari" of menu bar 1
--Open Security Tab
click button "Security" of tool bar 1 of window 1
--Show Cookies Button in Security Tab
click button "Show Cookies" of group 1 of group 1 of window "Security"
--Remove All in the Security:Show Cookies sheet
click button "Remove All" of sheet 1 of window "Security"
--Click "Remove All" in the pop-up confirmation dialog
click button "Remove All" of window 1
--Done with the Security:Show Cookies sheet
click button "Done" of sheet 1 of window 1
--Done with the Security Tab
click button 1 of window "Security"
end tell
end tell
--------
The issue is that at some point after the confirmation dialog comes up (click button "Remove All" of sheet 1 of window "Security") the script freezes for a couple of seconds. This behavior does not occur when manually activating the buttons. Any ideas?