on createTemp() tell application "Finder" -- create the temp folder at the root of the startup disk set tempLocation to (name of startup disk) & ":TempFolder:" try if (exists folder tempLocation) then -- if it's there, get rid of it do shell script "rm -fR /TempFolder/; sleep 1" end if make folder in startup disk with properties {name:"TempFolder"} -- make a clean (empty) copy of the temporary folder on error display dialog "Could not create temporary folder at root of startup disk." end try end tell return end createTemp on CheckForUpdate() -- this handler written by David Klawiter set CurrentVersion to (get version of parent of my parent) as number set the target_URL to "http://yoursite.edu/CurrentVersion.txt" set the destination_file to tempLocation & "CurrentVersion.txt" try tell application "URL Access Scripting" activate download target_URL to file destination_file replacing yes quit end tell set destination_file to alias (destination_file) open for access destination_file set entryLabel to read destination_file until "=" set UpdateVersion to read destination_file before return as string close access destination_file if CurrentVersion < UpdateVersion then set programLocation to (path to me) as string tell application "Finder" to set the programLocationContainer to (container of item programLocation) as string tell application "Finder" to move file (path to me) to tempLocation with replacing set the target_URL to "http://yoursite.edu/NewProgram.app.hqx" --New program tell application "URL Access Scripting" activate download target_URL to file programLocation with unpacking quit end tell set slashName to quoted form of POSIX path of programLocationContainer & "NewProgram.app" set shcmd to "chmod 755 " & slashName do shell script shcmd do shell script "open " & slashName -- open the app "NewProgram" quit -- NewProgram is now frontmost application end if end try return end CheckForUpdate