I’m writing a script to empty the cache in Safari before running some other command within the browser. Anyways my question is this, how do I access both the command and option key down simultaneously while pressing the “e” key? I’ve tried using command down and option down as handlers but that didn’t seem to work, and there’s no specific key codes for function keys as far as I know. I’d love to bypass this altogether by telling Safari to simply “empty cache” but it doesn’t recognize the cache command.
Thanks,
Anthony
Model: MacBook
AppleScript: 2.2
Browser: Safari 525.13
Operating System: Mac OS X (10.5)
--Empty Safari's cache
tell application "System Events"
tell application "Safari" to activate
tell process "Safari" to keystroke "e" using command down & option down
delay 1
keystroke return
end tell
I don’t know, where the cache is located in Leopard (I’m currently “on the road” with my Tiger-PowerBook ;))
but probably it’s easier to empty the cache this way