Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
1. Save the Script in the folder User>Library>Scripts.
2. Then make sure you have enabled the Script menu. Go to Applications>AppleScript and double-click the item Install Script Menu.
3. Create a one-time or a repeating event in iCal
4. Set the alarm properties on that event to open your AppleScript application

To run it when an event is scheduled is to have the alarm set to "Open file" and then select the script as the file to open. Once set, as long as you are logged in to the computer at the time the event is scheduled for, the AppleScript should be executed.
 
Bern said:
The Terminal Way

Using your Admin account, you can execute all three maintenance scripts at once, as follows:


Thanks BERN, I always wanted to know how to do that.
 
Bern said:
1. Save the Script in the folder User>Library>Scripts.
2. Then make sure you have enabled the Script menu. Go to Applications>AppleScript and double-click the item Install Script Menu.
3. Create a one-time or a repeating event in iCal
4. Set the alarm properties on that event to open your AppleScript application

To run it when an event is scheduled is to have the alarm set to "Open file" and then select the script as the file to open. Once set, as long as you are logged in to the computer at the time the event is scheduled for, the AppleScript should be executed.
Here is an alternative method that does a little more than run just these scripts. You'll have to read a couple of posts in this thread, but it works very well.
https://forums.macrumors.com/threads/157619/
 
Bern said:
I think that only applies if your Mac is asleep. When it wakes up it will automatically run those tasks, but if you shut it down the tasks won't be run at all until the next time around (as long as it is awake or asleep).

This is true. However, if you install Anacron then periodic (or "cron") tasks will be run at the time that they are set to run or the next time the machine is awake if the machine is shutdown or asleep when the tasks are set to run.
 
mrichmon said:
This is true. However, if you install Anacron then periodic (or "cron") tasks will be run at the time that they are set to run or the next time the machine is awake if the machine is shutdown or asleep when the tasks are set to run.

That's true :) however I was responding to using Terminal rather than installing an app to do this.
 
mrichmon said:
This is true. However, if you install Anacron then periodic (or "cron") tasks will be run at the time that they are set to run or the next time the machine is awake if the machine is shutdown or asleep when the tasks are set to run.
I don't think Anacron does not run the daily, weekly, monthly scripts in Tiger. Anacron runs cron scripts. Being that the scripts are now controlled by Launchd, Anacron probably skips them.
 
grapes911 said:
I don't think Anacron does not run the daily, weekly, monthly scripts in Tiger. Anacron runs cron scripts. Being that the scripts are now controlled by Launchd, Anacron probably skips them.

The release of "Anacron for MacOS 10.4 (Tiger)" has updated anacron to work with the launchd invocation of the periodic tasks. According to http://members.cox.net/18james/anacron-tiger.html.

Also, looking at the logs on my OS X 10.4.3 machines I can tell by the dates of the rotated logs that anacron is triggering the periodic tasks.
 
mrichmon said:
The release of "Anacron for MacOS 10.4 (Tiger)" has updated anacron to work with the launchd invocation of the periodic tasks. According to http://members.cox.net/18james/anacron-tiger.html.

Also, looking at the logs on my OS X 10.4.3 machines I can tell by the dates of the rotated logs that anacron is triggering the periodic tasks.

I was under the impression that under 10.4, there is no longer a need to use Anacron being that the scripts are run under launchd and that they will automatically run any time during the day as soon as you wake up your computer. Am I wrong on this??
 
CalGrunt said:
I was under the impression that under 10.4, there is no longer a need to use Anacron being that the scripts are run under launchd and that they will automatically run any time during the day as soon as you wake up your computer. Am I wrong on this??
Launchd will run the script if the computer was sleeping. If the computer was off, then they will not run.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.