automatic updating script

Hello all I think I have a doozy of a script question here… let me explain what I’m trying to accomplish.

We have a bunch of machines of varying processor types (G3s, G4s, and G5s). There are various programs installed on the machines (FCP5 studio, After Effects, Photoshop, iLife, etc). Mainly its to relieve manpower from having to hit continue, next, select HD, click next, etc etc.

What I would like the script to do:

  1. Check for a specific application file to see if the computer even has the software (say After Effects 6.5). Another challenge of this is the computers may or may not have the same hard drive name (Macintosh HD).

  2. Open the standalone installer .pkg file from a cd

  3. Click through the Installer windows (clicking continue, next, selecting the hard drive). Another challenge to this section is the authenticate window that pops up. For some reason I can not send any System Events commands to it except keystroke to the password section (Is this even the right way to go about this). The computers do not have a password, so hitting OK just gets rid of the screen. Another challenge here is the varying processor speeds. I don’t want to just use a “delay 1” or something cause I don’t know how long the G3 machine will take to select the Macintosh HD radio button vs the G5. I need some kind of “wait for process to finish” command.

  4. After installation is complete (again, wait for process to finish is needed) close the Installer and go on to the next program to check for existance.

heh forewarning though, I am a complete newbie at applescripting, just started learning about an hour ago, so the code has got to be really sloppy and just plain wrong.


on run
	set app_path to (path to applications folder from user domain & "Adobe After Effects 6.5") as string
	try
		set ae_ref to (app_path & "Adobe After Effects 6.5") as alias
		
		-- Adobe After Effects 6.5 Update Start (App File Found)
		tell application "Finder"
			open file "Adobe After Effects 6.5.1 Update.pkg" of folder "ITV Updates 07-05"
		end tell
		delay 1
		tell application "System Events"
			tell process "Installer"
				tell window "Install Adobe After Effects 6.5.1 Update"
					click button "Continue"
					delay 3
					tell scroll area 1
						tell radio group 1
							click button "Macintosh HD"
							delay 1
						end tell
						
						tell application "System Events"
							tell process "Installer"
								tell window "Install Adobe After Effects 6.5.1 Update"
									click button "Continue"
									click button "Install"
									delay 1
								end tell
							end tell
						end tell
						delay 1
						
						tell application "System Events" to click at {765, 434}
					end tell
				end tell
			end tell
		end tell
		
		-- Adobe After Effects 6.5 Update Start
		
		
	on error -- file wasn't found - skipping to next install package
		-- do nothing
		
	end try
end run


It’s probably all wrong. But hey, it’s a learning process :frowning: