Mac Forums

Mac Forums (http://www.mac-forums.com/forums/)
-   OS X - Development and Darwin (http://www.mac-forums.com/forums/os-x-development-darwin/)
-   -   Script to Open all Programs (http://www.mac-forums.com/forums/os-x-development-darwin/93216-script-open-all-programs.html)

Slokunshialgo 01-19-2008 08:32 PM

Script to Open all Programs
 
At work, we have a number of Macs for student use, requiring us to make sure everything opens and runs properly every time we do an update, prior to distributing the new images to all the other macs around.

What my boss has asked me to do is make something, he doesn't care how, to open every program in the Applications folder one by one. So, basically, you might have iDVD open, the script, automator program, whatever, would then wait until it is closed, then go onto iMovie, wait, then go to iPhoto when iMovie is closed, etc. It would keep on doing this until every application has been opened.

Thus far, I have been able to make an Automator program that looks in the folder, gets all the programs contained therein, and open them. Unfortunately, it opens everything at once, which can quickly crash the machine.

Does anybody here know if this is doable? The only limitation is that it has to run without a terminal, which would probably rule out a bash script (Although I haven't tried this, so I cannot entirely rule it out). I'm not looking for an exact script to do this, but a starting point to figure this out. I've had suggested AppleScript, but I don't know this language at all, so I don't know what is possible with it, and what's not.

Brown Study 01-19-2008 10:59 PM

I'm no expert AppleScripter (as the following proves), but it would be easier to write if each Applications folder is absolutely identical to every other. You might then write something with Script Editor like this that would cover every app in each machine:

Tell application "Asteroids"
activate
quit
end tell
tell application "Bozo Breath"
activate
quit
end tell

etc. etc. through the entire list in the apps folder, then the Utilities folder apps, I suppose.

I'm sure there's an easier, faster way of writing it, involving repeats, aliases and stuff. But this one, unwieldy as it might get, should work I think.

If you try it, save the AppleScript as an application. If the script stalls, insert delays between each application and/or between each activation and quit:

tell application "Asteroids"
activate
delay 1
quit
end tell
delay 2
tell application "Bozo Breath"
activate

etc. etc. You can lengthen the delays by using higher numbers. If you store the script in the Apps folder, don't include it in the list. :)

Willgecko 01-22-2008 10:09 PM

yeah that should work


All times are GMT -4. The time now is 01:18 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.