I wrote an Applescript a while back which effectively does exactly what you want. I was distributing a CD with a variety of different software installers on it. When running the script, the user would be presented with a list of software included on the CD. The use can then choose the application they want to install, and the script will launch that installer. I think you can probably modify this to meet your needs. I designed it so it will read in a file with the name to display for each application, and the name of the installer itself. The syntax for this file is a bit stupid. It is a text file, which should have first the name you want to display, then a semicolon (
and carriage return, and then the name of the application you want to run followed by a semicolon and carriage return. Repeat this for each application, so you will have a list like:
AOL;
America Online;
iTunes;
iTunes;
AppleWorks;
AppleWorks 6.2.3;
A carriage return after the last line is important. You could probably even modify it to do away with the need for two entries for each app. With the installers I was dealing with, the name of the installers did not really make it obvious what the program was (e.g. the users this would targeted at wouldn't know that NAV80 was Norton Antivirus). The advantage of doing this with a file is that you won't have to modifu and recompile your script of if you want to launch more applications in the future. Just fire up SimpleText and add some lines to the text file.
Let me know if you need more explanation of anything here.
Here it is (I've added comments in the parts I think you will need to change:
-- initialize variables
set i to 1
set AppList to {}
set InstList to {}
-- change delimiter to parse our file
set AppleScript's text item delimiters to ";" & (ASCII character 13)
-- copy the text of the file into a variable
--change two lines below to match location of your text file
open for access file "Network Clients Installer:Installer List"
set raw_text to read file "Network Clients Installer:Installer List"
-- seperate each item into a list
set text_list to text items of raw_text
-- divide up the list: we want a list of names to display and a list of associated installers
set n to the number of items in text_list
repeat while i < n
set AppList to AppList & item i of text_list
set InstList to InstList & item (i + 1) of text_list
-- return AppList
set i to (i + 2)
end repeat
-- ask user which application to install, save this is "selected_app"
set the dialog_result to ¬
choose from list AppList with prompt "Please choose the software you would like to install"
if the dialog_result is false then
return "action cancelled by user"
else
set selected_app to the first item of the dialog_result
end if
-- find the installer associated with "selected_app"
repeat with i from 1 to the count of the AppList
if item i of the AppList is the selected_app then
set inst to item i of the InstList
exit repeat
end if
end repeat
-- run the installer
tell application "Finder"
activate
--you will need to change this to match the location of your stuff. probably
--open file (inst as string) of Desktop
open file (inst as string) of folder "Software Installers" of disk "Network Clients Installer"
end tell