Automatically delete temporary ~/Library/Application Support folders

applescriptautomator

I have a flash drive which I carry around everywhere which has a few standalone applications which I use everywhere installed on it. However, the majority of these leave Application Support folders behind, and I don't want to give other people access to any of my information, etc.

Is there any way to automatically delete these folders either just before or just after I remove my flash drive? I've tried writing an Automator workflow to do this, and it works, but it feels very kludgy.

Also, most specifics that I've said are flexible; I just want something that will do the job 100% of the time.

Best Answer

I suggest you use a guest account on OS X if you want certain home directory files automatically erased for you. A guest account's home directory gets cleaned up when you log out.

From http://docs.info.apple.com/article.html?path=Mac/10.7/en/mh35549.html:

Important: Files created by a guest user are deleted when the user logs out. A temporary home folder is created for the guest user’s files, but this folder and its contents are deleted when the user logs out.