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

oldschool

macrumors 65816
Original poster
I'm extremely new to applescript. I know its always been there but i never learned how to use it.

Now i wanted to make some scripts to run the cron maintenance, and have it scheduled through iCal. This is the script I wrote:

tell application "Terminal"
activate
do shell script "sudo periodic daily" password "mypassword" with administrator privileges
end tell

tell application "Terminal"
quit
end tell


As far as i can tell it opens up terminal, performs the maintenance and closes terminal...but I have my doubts. Can I make it better?
 
To schedule cron jobs the best solution is cronnix. Its a nice little app that provides gui access to setting up cron jobs (such as the maintenance commands).

Look for it on versionTracker or google.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.