I am making an application that involves controlling Safari from Applescript. Is there a way in the Terminal (preferred) or Applescript to erase Safari's cookies. Basically I want to the "Reset Safari" item from the menu using the Terminal. Is there a method that can do this?
Reset Safari does more than just erasing the cookies:
Basically I want to the "Reset Safari" item from the menu using the Terminal.
If you would want to completely reset Safari from the terminal, you would use (depending on the Safari version the commands may vary):
rm ~/Library/Safari/History.plist
rm ~/Library/Safari/Downloads.plist
rm ~/Library/Safari/HistoryIndex.sk
rm ~/Library/Safari/LastSession.plist
rm ~/Library/Safari/TopSites.plist
rm -rf ~/Library/Caches/com.apple.safari
And (a little unsure about the last one):
rm ~/Library/Safari/SearchProviders.plist.signed
You could simply delete the Cookies.plist
file:
rm ~/Library/Cookies/Cookies.plist
Or take a look at this: List & delete Safari cookies
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With