This is my Safari-quit script saved as an application. I don't use Safari's quit command when the paranoids are after me. (You must make and wear a tinfoil hat before running it, or it won't work.) Private Browsing is OK, but it can't delete a lot of stuff created by other apps that could make Safari's deletions moot.
At the bottom of the script, I set up the trash to open so I can see that the script ran properly. The trash closes when it securely deletes the files. "Enable GUI Scripting" must be turned on in the AppleScript Utility. A couple or three files and pathways are different in Intel Macs, and some, of course, wouldn't exist in any Mac if it doesn't have the same apps or has others I don't use.
Safari, though, creates a ton of junk to be trashed, and securely deleting it all after a long session is like watching paint dry. But I hardly ever run Safari.
Whenever I discover another app that leaves a trail, I add it to the script. I have another script for Firefox to take care of its unique properties, but it includes all the other apps this one does. Those, though, are a simple copy-and-paste job.
These scripts need constant updating, however. When I installed the newest Adobe Reader, for example, the pathway to the cookies changed. And Flash's " #SharedObjects" is tricky. It starts with a space.
Code:
tell application "Safari"
quit
end tell
delay 2
tell application "Finder"
activate
if every item of folder "Safari" of folder "Caches" of folder "Library" of folder "Brown Study" of folder "Users" of startup disk exists then
delete every item of folder "Safari" of folder "Caches" of folder "Library" of folder "Brown Study" of folder "Users" of startup disk
end if
if file "History.plist" of folder "Safari" of folder "Library" of folder "Brown Study" of folder "Users" of startup disk exists then
delete file "History.plist" of folder "Safari" of folder "Library" of folder "Brown Study" of folder "Users" of startup disk
end if
if file "Cookies.plist" of folder "Cookies" of folder "Library" of folder "Brown Study" of folder "Users" of startup disk exists then
delete file "Cookies.plist" of folder "Cookies" of folder "Library" of folder "Brown Study" of folder "Users" of startup disk
end if
if file "Acrobat WebCapture Cookies" of folder "8.0_ppc" of folder "Acrobat" of folder "Preferences" of folder "Library" of folder "Brown Study" of folder "Users" of startup disk exists then
delete file "Acrobat WebCapture Cookies" of folder "8.0_ppc" of folder "Acrobat" of folder "Preferences" of folder "Library" of folder "Brown Study" of folder "Users" of startup disk
end if
if every item of folder "TemporaryItems" of folder "Caches" of folder "Library" of folder "Brown Study" of folder "Users" of startup disk exists then
delete every item of folder "TemporaryItems" of folder "Caches" of folder "Library" of folder "Brown Study" of folder "Users" of startup disk
end if
if every item of folder "Recent Applications" of folder "Apple Menu Items" of folder "Classic" of folder "Library" of folder "Brown Study" of folder "Users" of startup disk exists then
delete every item of folder "Recent Applications" of folder "Apple Menu Items" of folder "Classic" of folder "Library" of folder "Brown Study" of folder "Users" of startup disk
end if
if every item of folder "Stuffit Deluxe Recent Items" of folder "Allume" of folder "Preferences" of folder "Library" of folder "Brown Study" of folder "Users" of startup disk exists then
delete every item of folder "Stuffit Deluxe Recent Items" of folder "Allume" of folder "Preferences" of folder "Library" of folder "Brown Study" of folder "Users" of startup disk
end if
if folder "#SharedObjects" of folder "Flash Player" of folder "Macromedia" of folder "Preferences" of folder "Library" of folder "Brown Study" of folder "Users" of startup disk exists then
delete folder "#SharedObjects" of folder "Flash Player" of folder "Macromedia" of folder "Preferences" of folder "Library" of folder "Brown Study" of folder "Users" of startup disk
end if
if folder "macromedia.com" of folder "Flash Player" of folder "Macromedia" of folder "Preferences" of folder "Library" of folder "Brown Study" of folder "Users" of startup disk exists then
delete folder "macromedia.com" of folder "Flash Player" of folder "Macromedia" of folder "Preferences" of folder "Library" of folder "Brown Study" of folder "Users" of startup disk
end if
if file "com.apple.Preview.bookmarks.plist" of folder "Preferences" of folder "Library" of folder "Brown Study" of folder "Users" of startup disk exists then
delete file "com.apple.Preview.bookmarks.plist" of folder "Preferences" of folder "Library" of folder "Brown Study" of folder "Users" of startup disk
end if
if file "com.apple.Preview.plist" of folder "Preferences" of folder "Library" of folder "Brown Study" of folder "Users" of startup disk exists then
delete file "com.apple.Preview.plist" of folder "Preferences" of folder "Library" of folder "Brown Study" of folder "Users" of startup disk
end if
if file "com.apple.quicktimeplayer.plist" of folder "Preferences" of folder "Library" of folder "Brown Study" of folder "Users" of startup disk exists then
delete file "com.apple.quicktimeplayer.plist" of folder "Preferences" of folder "Library" of folder "Brown Study" of folder "Users" of startup disk
end if
if file "org.videolan.vlc.plist" of folder "Preferences" of folder "Library" of folder "Brown Study" of folder "Users" of startup disk exists then
delete file "org.videolan.vlc.plist" of folder "Preferences" of folder "Library" of folder "Brown Study" of folder "Users" of startup disk
end if
if every item of folder "downloads" of folder "QuickTime" of folder "Caches" of folder "Library" of folder "Brown Study" of folder "Users" of startup disk exists then
delete every item of folder "downloads" of folder "QuickTime" of folder "Caches" of folder "Library" of folder "Brown Study" of folder "Users" of startup disk
end if
if file "com.RealNetworks.RealPlayer.plist" of folder "Preferences" of folder "Brown Study" of folder "Library" of folder "Users" of startup disk exists then
delete file "com.RealNetworks.RealPlayer.plist" of folder "Preferences" of folder "Brown Study" of folder "Library" of folder "Users" of startup disk
end if
delay 2
make new Finder window to trash
set current view of Finder window 1 to list view
set toolbar visible of Finder window 1 to false
set bounds of Finder window 1 to {234, 587, 797, 768}
end tell
delay 1
tell application "System Events" to tell application process "Finder"
set frontmost to true
(* to get the exact menu item number
get name of every menu item of menu "Finder" of menu bar item "Finder" of menu bar 1
get name of menu item 7 of menu "Finder" of menu bar item "Finder" of menu bar 1
*)
click menu item 7 of menu "Finder" of menu bar item "Finder" of menu bar 1
keystroke return
end tell