PDA

View Full Version : Login Items - delay intended


Jacques
02-02-2004, 10:58 AM
I have several programs to launch, as startup items.

I've noticed that everytime I startup, every program in my Login Items list tried to launch at the same time - crunching the drive up and slowing things down.

What's the best way to force the startup process to load each program up, one at a time?

Jacques

hayne
02-02-2004, 12:24 PM
You could write an AppleScript to launch the apps at the rate that you want.

Jacques
02-02-2004, 01:15 PM
I tried to do this with the AS editor, by hitting record and launching each program - it turns out only some would record.

Does it only record programs that are AS aware? ..or Cocoa?

Jacques

gatorparrots
02-02-2004, 01:36 PM
tell application "some application" to activate
do shell script "/bin/sleep 2"
tell application "another application" to activate
do shell script "/bin/sleep 4"
tell application "big application" to activate
do shell script "/bin/sleep 20"
tell application "onelast application" to activate

mervTormel
02-02-2004, 01:53 PM
isn't there an AS delay or wait command?

jdhorner
02-02-2004, 02:48 PM
yes.

it's delay 1 where "1" is the number of seconds you want to delay.

Jacques
02-02-2004, 04:11 PM
Okay, I'll try it. Thank you.

My assumption was that because the AS recorder didn't catch some of those applications launching, I would have to find another solution.

Jacques

gatorparrots
02-02-2004, 06:10 PM
Originally posted by jdhorner
yes.

it's delay 1 where "1" is the number of seconds you want to delay.
Due to a bug in AppleScript, the delay command usually consumes nearly 100% of the available CPU. The do shell script "/bin/sleep n"syntax consumes almost no CPU resources.

jdhorner
02-02-2004, 06:18 PM
and the truth is revealed. ;-)