Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Automating When Applications turn on and turn off?

Automating When Applications turn on and turn off?
Thread Tools
Dedicated MacNNer
Join Date: Sep 2001
Location: Cedar Rapids, Iowa
Status: Offline
Reply With Quote
Aug 24, 2003, 08:47 PM
 
Is there any way to setup an "application schedule" where I would set a given application to be ran at a certain time and then shut off at a different time, all without me having to fuss with it? That would be really great for certain apps.
15" PowerBook G4 1.5 GHZ w/ 128MB VRAM
512MB DDR SDRAM 1 SODIMM
80GB 5400 RPM HD
Mac OS X 10.3.4
     
Senior User
Join Date: Nov 2001
Location: State of Denial
Status: Offline
Reply With Quote
Aug 25, 2003, 05:21 AM
 
cron?
[Wevah setPostCount:[Wevah postCount] + 1];
     
Dedicated MacNNer
Join Date: Sep 2001
Location: Cedar Rapids, Iowa
Status: Offline
Reply With Quote
Aug 25, 2003, 02:34 PM
 
How would I go about setting up cron jobs on OS X?
15" PowerBook G4 1.5 GHZ w/ 128MB VRAM
512MB DDR SDRAM 1 SODIMM
80GB 5400 RPM HD
Mac OS X 10.3.4
     
Mac Elite
Join Date: Sep 2000
Location: New York
Status: Offline
Reply With Quote
Aug 25, 2003, 03:10 PM
 
I am also interested in this. I know how to get applications to launch with cron but how do I get them to quit via cron?
     
Senior User
Join Date: Nov 2001
Location: State of Denial
Status: Offline
Reply With Quote
Aug 25, 2003, 03:15 PM
 
Hmm...does 'kill'ing the process (without flags) quit the app normally? If it does, you could use killall...
[Wevah setPostCount:[Wevah postCount] + 1];
     
Addicted to MacNN
Join Date: Jan 2003
Location: ~/
Status: Offline
Reply With Quote
Aug 25, 2003, 11:05 PM
 
While I have no first-hand experience in programming with AppleScript, I know that all this can be done (launching, safely quitting, plus of course lots more) via AppleScript.

A cron job can be set to launch an AppleScript, which can then control the application.
     
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status: Offline
Reply With Quote
Aug 25, 2003, 11:43 PM
 
Originally posted by Cadaver:
While I have no first-hand experience in programming with AppleScript, I know that all this can be done (launching, safely quitting, plus of course lots more) via AppleScript.

A cron job can be set to launch an AppleScript, which can then control the application.
No need to use an AppleScript, just use the "osascript" command with the "-e" option to run a single appleScript command . Eg,

osascript -e tell application "TextEdit" to <do-something>
     
Professional Poster
Join Date: Sep 2002
Location: New York, NY
Status: Offline
Reply With Quote
Aug 25, 2003, 11:48 PM
 
To start an app, you can have a cron job that is either

Code:
osascript -e tell application "TextEdit" to activate
or

Code:
open /Applications/TextEdit.app
To quit an app, you can have this as a cron job

Code:
osascript -e tell application "TextEdit" to quit
Vandelay Industries
     
Professional Poster
Join Date: Sep 2002
Location: New York, NY
Status: Offline
Reply With Quote
Aug 25, 2003, 11:49 PM
 
Originally posted by Wevah:
Hmm...does 'kill'ing the process (without flags) quit the app normally? If it does, you could use killall...
No, it is like Force Quitting.
Vandelay Industries
     
Grizzled Veteran
Join Date: Dec 2000
Location: Málaga, Spain, Europe, Earth, Solar System
Status: Offline
Reply With Quote
Aug 26, 2003, 02:20 AM
 
Originally posted by Art Vandelay:
To start an app, you can have a cron job that is either

Code:
osascript -e tell application "TextEdit" to activate
Bad, the working command is:

Code:
osascript -e 'tell application "TextEdit" to activate'
You forgot the single quotes to embrace the AppleScript language.
     
Senior User
Join Date: Nov 2001
Location: State of Denial
Status: Offline
Reply With Quote
Aug 26, 2003, 04:28 AM
 
Originally posted by Art Vandelay:
No, it is like Force Quitting.
Damn. Yeah, do the osascript thing. That completely slipped my mind. :O
[Wevah setPostCount:[Wevah postCount] + 1];
     
Professional Poster
Join Date: Sep 2002
Location: New York, NY
Status: Offline
Reply With Quote
Aug 26, 2003, 12:53 PM
 
Originally posted by eevyl:
Bad, the working command is:

Code:
osascript -e 'tell application "TextEdit" to activate'
You forgot the single quotes to embrace the AppleScript language.
Thanks. My bad.
Vandelay Industries
     
Dedicated MacNNer
Join Date: Sep 2001
Location: Cedar Rapids, Iowa
Status: Offline
Reply With Quote
Aug 26, 2003, 05:02 PM
 
How do you edit cron jobs tho?
15" PowerBook G4 1.5 GHZ w/ 128MB VRAM
512MB DDR SDRAM 1 SODIMM
80GB 5400 RPM HD
Mac OS X 10.3.4
     
Junior Member
Join Date: Jan 2000
Status: Offline
Reply With Quote
Aug 26, 2003, 05:49 PM
 
I haven't tried any yet, but there are a couple of GUIs over cron. E.g., http://www.koch-schmidt.de/cronnix/
     
Dedicated MacNNer
Join Date: Sep 2001
Location: Cedar Rapids, Iowa
Status: Offline
Reply With Quote
Aug 26, 2003, 09:51 PM
 
Thanks!

I'm testing this all tonight. If it works, I think I have a way for iSiloX to autoupdate
15" PowerBook G4 1.5 GHZ w/ 128MB VRAM
512MB DDR SDRAM 1 SODIMM
80GB 5400 RPM HD
Mac OS X 10.3.4
     
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status: Offline
Reply With Quote
Aug 27, 2003, 12:24 AM
 
Originally posted by crystalthunder:
How do you edit cron jobs tho?
cron -e

For syntax of the cron file...

man cron


Otherwise use a GUI tool.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 10:12 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2