 |
 |
Automating When Applications turn on and turn off?
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Sep 2001
Location: Cedar Rapids, Iowa
Status:
Offline
|
|
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
|
|
|
|
|
[Wevah setPostCount:[Wevah postCount] + 1];
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Sep 2001
Location: Cedar Rapids, Iowa
Status:
Offline
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
|
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Sep 2001
Location: Cedar Rapids, Iowa
Status:
Offline
|
|
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
|
|
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.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|