Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

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.

share|improve this answer
    
I can't use a guest account, as there is none and I don't have administrator privileges to create one. –  timothymh Jan 22 '12 at 17:11

I know you already tried writing an Automator workflow for this, but this is probably the best way to do it. Can you post what you did for your workflow?

What I would suggest is creating an Application in Automator and use the "Run Shell Script" action. For the command, use rm ~/Library/Application\ Support/* and this will delete all files inside the Application Support folder. Now, this is going to delete ALL Application Support files...even the user's your logged into.

If you want to avoid this, you can do one of two things. The easiest would be just use the guest account of that computer like @bneely suggests.

You can also set up more than one shell script to delete only the directories that you specify. For example if you're transporting CoRD.app around with you, you could add the action rm -rf ~/Library/Application\ Support/CoRD and add another action for each application you use. It's a little tedious, but effective.

Let me know if you need further assistance setting it up.

share|improve this answer
    
That's always assuming the program isn't already installed and having been ran on the machine he plugs in to. I'd add a check for the app in the /Applications and ~/Applications folders prior to deletion of the files –  Stu Wilson Jan 20 '12 at 16:39
    
agreed. all in all, the guest account is definitely going to be easier! –  Matt Love Jan 20 '12 at 17:13
    
Unfortunately I can't use the guest account solution, as there is none and I don't have the admin privs necessary to create one, but I'll just fine-tune the Automator script, I guess. I've been using "Get Specified Files" and then "Move Files to Trash". The arguments for Get Files are of course the folders, and if a folder doesn't exist it simply skips that one. –  timothymh Jan 22 '12 at 17:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.