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

tray

macrumors member
Original poster
Nov 25, 2006
68
0
Hey all,

I would like to schedule the opening and closing of specific applications at specific times.

The reason why I would like to do so is that I use alarm apps like Awaken and Aurora. However, they require that ‘Password while Screen-saver is running’ is disabled. I use a password protected screen-saver to prevent curios colleagues from poking my Mac when I’m out for lunch.

The developers have suggested that I run the specific alarm application when I need to and close it after the alarm has sounded. The password protection for the screen-saver will be enabled when the alarm app is closed. Is there any application that can schedule the alarm app to do so?

I have found apps like MacAT, Lingon & Cronnix. While they can open apps at specific time, I don’t think they can close apps at specific times. Well, at least I don’t know how to.

Any help is appreciated.

Thanks guys!
 
Most of those apps manipulate cron (which is a unix-level task scheduling system in OS X as well as most other Unix/Linux/et ceterix variants) to run an app at a scheduled time. You can also even more simply use iCal to do it, if your needs are very basic.

Now as for the question of how to stop an application... you have two basic options:

1) If the application supports it (better option), you can use AppleScript -- you can generate a very simple AppleScript that tells the app to close itself. This applescript can then be itself executed like an application by iCal or by cron.

2) If not, you can turn the application off by using kill or one of its variants and a shell script. Kill is a unix command that kills a process based on its identification. The easiest way to use it in this context is to use the killall variant -- which kills apps based on keyword matching. Were the application process called Aurora, killall Aurora would kill it. The disadvantage is that whether or not you get a "clean" exit varies substantially with how the app Aurora or Awaken or whatever was written. May or may not be an issue.
 
Most of those apps manipulate cron (which is a unix-level task scheduling system in OS X as well as most other Unix/Linux/et ceterix variants) to run an app at a scheduled time. You can also even more simply use iCal to do it, if your needs are very basic.

Now as for the question of how to stop an application... you have two basic options:

1) If the application supports it (better option), you can use AppleScript -- you can generate a very simple AppleScript that tells the app to close itself. This applescript can then be itself executed like an application by iCal or by cron.

2) If not, you can turn the application off by using kill or one of its variants and a shell script. Kill is a unix command that kills a process based on its identification. The easiest way to use it in this context is to use the killall variant -- which kills apps based on keyword matching. Were the application process called Aurora, killall Aurora would kill it. The disadvantage is that whether or not you get a "clean" exit varies substantially with how the app Aurora or Awaken or whatever was written. May or may not be an issue.

Hmm, you presented a lot for me to chew on and understand. Will have to Google and learn i guess.
 
here is very simple applescript to do that through ical.

tell application "application name"
activate
end tell


open applescript - script editor to write that script, then in ical set an appointment to repeat everyday, under the alarm option tell it to run script and select the applescript you have made.

to close it, write another applescript that says


tell application "application name"
quit
end tell

set another appointment in ical and set that script to it.
 
Perfect

That is so awesome, Wallace! That's exactly what I was looking for!

Thanks!
 
here is very simple applescript to do that through ical.

tell application "application name"
activate
end tell


open applescript - script editor to write that script, then in ical set an appointment to repeat everyday, under the alarm option tell it to run script and select the applescript you have made.

to close it, write another applescript that says


tell application "application name"
quit
end tell

set another appointment in ical and set that script to it.
:) worked a treat
I did find that just...
tell application "application name"
quit
end tell
...wasn't enough as the application failed to close so i repeated 4 times which worked
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.