Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Dark09

macrumors newbie
Original poster
Oct 23, 2012
5
0
I've been working on this script all day (first real apple script) and I've been able to get this to run from the root of the volume, but not under /usr/bin, so I tried creating a separate folder and used chown, but so far i'm still not able to clear out my desktop...

The purpose of this script is for this to be part of the net restore deployment image and for this apple script to generate the files to be used to create a startup/login item to clear the users desktop.

Any help on getting this script to work would be epic!

Here's what i've build thus far:

Code:
do shell script "mkdir /usr/bin/cleardesktop" with administrator privileges
do shell script "chown root:staff /usr/bin/cleardesktop" with administrator privileges
do shell script "touch /usr/bin/cleardesktop/cleardesktop.command" with administrator privileges
do shell script "echo \"#!/bin/bash\" > /usr/bin/cleardesktop/cleardesktop.command" with administrator privileges
do shell script "echo \"rm -rf ~/Desktop/\" >> /usr/bin/cleardesktop/cleardesktop.command" with administrator privileges
do shell script "chmod +x /usr/bin/cleardesktop/cleardesktop.command" with administrator privileges
do shell script "chmod 777 /usr/bin/cleardesktop/cleardesktop.command" with administrator privileges
#####do shell script "chown root:staff /usr/bin/cleardesktop/cleardesktop.command" with administrator privileges
do shell script "mkdir /System/Library/StartupItems/cleardesktop.command" with administrator privileges
do shell script "ln -s /usr/bin/cleardesktop/cleardesktop.command /System/Library/StartupItems/cleardesktop.command/cleardesktop.command" with administrator privileges
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.