9 Replies Latest reply: Mar 15, 2013 2:09 PM by fastprof
HenryS Level 2 Level 2 (295 points)

I get how to use a service or to build an application. But do you build to run at a specific time or day? I need to automate my server shutdown and MacMini shutdown when a server is involved due to active users restricting the System Prefs shutdown. I thought to automate the shutdown and successfully built a Shutdown_my_Server.app which can be totally automatic or require user input.

 

Now, how to execute/launch/run the app at a specific time??


Mac mini, OS X Mountain Lion, (3,1) 3GB RAM, 2GHz, C2D, JBOD Ext.
  • red_menace Level 6 Level 6 (14,900 points)

    You can use Calendar.app to launch your application at a specific or repeating date/time, or schedule a shutdown using the Energy Saver preference.

  • HenryS Level 2 Level 2 (295 points)

    Thanks, Red...

     

    Energy Saver won't work because the Server needs additional input (turn off/disconnect user dialog). I'll look at Calendar.app to schedule a launch at specific times/day. The use of Calendar is a good idea if it works, didn't realize a launch could be scheduled there.

     

    Henry

  • HenryS Level 2 Level 2 (295 points)

    red_menace wrote:

     

    You can use Calendar.app to launch your application at a specific or repeating date/time,

    Please explain how that could be done.

  • red_menace Level 6 Level 6 (14,900 points)

    Start the Calendar application and choose a date, then double-click at some time on the date to create a new event.  Once an event has been created, you can double-click on it or use Get Info to edit the event time, type of alert, if you want it to repeat, etc.  There are various ways that you can have the event alert or notify you when it happens - by using Open File, you can also choose an application that will be run.  The Calendar application does not need to be running for the scheduled events to do their thing.

  • HenryS Level 2 Level 2 (295 points)

    Red,

     

    Having this "Open..." feature to run an application in the Alerts menu is not exactly intuitive to me, so thanks for explaining it. I guess the ony problem I can see using the Calendar app to schedule this is sharing the calendar events, which I do. Of course, since the app doesn't exist on the other machine, there is no problem, however I would consider this a work-around at best.

     

    OTO, you could use a common appointment, along with a copy of the shutdownapp in place, to shut everybody down with a single event, by moving the Shutdown.app to the target machine(s). It's a nice feature, sharing-wise.

     

    Any ideas for machine start up in a similar way? Is the startup using Energy Saver is the only alternative? Shouldn't Automator be capable?

     

    Henry

  • red_menace Level 6 Level 6 (14,900 points)

    A Calendar Alarm workflow can be created in Automator, but it just uses the Calendar application.  You can also schedule your application using launchd (which is more or less what Calendar.app does), but it is a bit more technical.

  • HenryS Level 2 Level 2 (295 points)

    red_menace wrote:

     

    A Calendar Alarm workflow can be created in Automator, but it just uses the Calendar application.  You can also schedule your application using launchd (which is more or less what Calendar.app does), but it is a bit more technical.

    First, I'll try my use of the Calendar event to get a single shutdown event across my shared calendar machines. I understand that launchd is sort of the same but uses Terminal to construct the process.

  • fastprof Level 1 Level 1 (10 points)

    Red_menace tags something that I am having some trouble with.  I hace an automator app in my applications folder.  It opens a folder, then gets all the files in that folder and ftps those files to my ISP.  

     

    I have it as an app that I have selected in iCal as an "Alert".  I have it running every day.  Then I duplicated it and have it run each hour of each day.  (It's transferring weather data to my weather station website).

     

    Here's the problem.  It's doing that fine.  But each time it executes the Alert another box comes up that says something like "...iCal is not able to find the application "GetWeatherData.app"...."  Meanwhile, it not only has found the app it executes it. 

     

    I realize it's not a big deal, but it's annoying to find my display littered witth that message if I am away for a few hours.  I wonder if anyone has inisghts on this issue.

     

    (By the way, ignore all advice on various help websites to execute an ftp transfer using a "Workflow".  You need to make an .app do do that.)

  • fastprof Level 1 Level 1 (10 points)

    I got my own answer after sleeping on it.   My iCal calendars were a mess, mostly thanks to iCloud.   Once I turned off iCloud calendars in System Preferences, and deleted all accounts, I was able to setup a local calendar that correctly accessed the application I created in Automator.   I no longer got any error notifications.