Script to clear Safari?
Script to clear Safari?
- Subject: Script to clear Safari?
- From: email@hidden
- Date: Mon, 22 Feb 2016 09:14:13 -0800
AppleScript Users,
I am looking for help to create an AppleScript which I can save in
Automator as an application. I would like the AppleScript to do two
things:
1) If any Safari windows & tabs are open, close them all;
2) Clear the cookies, cache, and history.
I've cobbled together a script that throws an error, but does accomplish
the clear history task. I tried Automator's follow my action/record
function, but the result won't work if the Safari window isn't in the
exact same place on the screen.
on run {input, parameters}
tell application "System Events"
tell process "Safari"
set frontmost to true
click menu item "Clear History
" of menu 1 of menu bar item
"Safari" of menu bar 1
delay 1
click button "Clear History" of window 1
end tell
end tell
return input
end run
Anyone have a suggestion on how to script Safari to "close windows" and
"clear history"?
Thanks,
Douglas Bat
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden