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

rethish

macrumors member
Original poster
Oct 16, 2008
41
0
hi,

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.
 

whooleytoo

macrumors 604
Aug 2, 2002
6,607
716
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.