Applescript for deleting desktop files upon logout

applescriptdeleting

I'm completely new to Applescript and currently very busy at work. I don't have time to learn it, I will once I find some free time, so I decided to ask you, the experts, for help.

I need an Applescript that will delete all desktop files upon log out. I'm currently running a Mac Lab with 40 iMacs and our students constantly save filed to Desktop, which creates a lot of clutter.

Best Answer

Is there any specific reason why you wouldn't want to have your students use a Guest Account on the system instead? That would allow you to provide them restricted access to the system while deleting all their files on logout automatically.

To enable a guest user:

  • Go to System Preferences > Users & Groups
  • Click the lock icon to unlock it if necessary and type an administrator name and password
  • Select the Guest User in the list of accounts from the left sidebar
  • Check the option Allow guests to log in to this computer
  • You can also setup restrictions through Parental Controls by checking the option Enable parental controls and then clicking on Open Parental Controls...

See:
Using the Guest Account in OS X
OS X Mountain Lion: Set up guest users
OS X Lion: Set up a guest account