How to Schedule an application?

Discussion in 'Mac Programming' started by rethish, Jul 20, 2009.

  1. rethish macrumors member

    Oct 16, 2008

    I want to schedule my application on a specified time.

    When the application is not running , the application should open on the specified time and process the scheduled task .

    If the application is running , the scheduled task should be processed within the application [without opening in a new application].

    I had tried using a plist file and launchd to do it, but it always opens in a new application.

    Is this can be done using applescript ?

    thank you in advance.
  2. whooleytoo macrumors 604


    Aug 2, 2002
    Cork, Ireland.
    There are probably a few ways of doing it.

    You could leave a helper application running, and let that do the scheduling. But, that might be a waste of resources.

    You could use launchd to launch a tiny 'launcher' process. This would check if your app is running, if so send it an NSNotification to start the task. If it's not running, launch your app and send it the NSNotification. Then the launcher app can quit.

Share This Page