Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Clean some Safari cookies via a Perl script' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Clean some Safari cookies via a Perl script
Authored by: jgreely on Feb 11, '09 05:54:42PM
Use /usr/libexec/PlistBuddy instead of parsing the file by hand.
/usr/libexec/PlistBuddy -c print ~/Library/Cookies/Cookies.plist
Ignore everything but the lines containing 'Domain = ', count them starting at 0, choose the ones you want to get rid of, print out 'delete :N' commands for them in reverse order, followed by a save and a quit, and feed those commands back into PlistBuddy on stdin (save a copy of your cookie file first!). Your commands should look like:

delete :458
delete :412
delete :300
delete :52
delete :3
save
quit
I've been using this technique since last April, and it works perfectly.

[ Reply to This | # ]