Hi all,
I assume, this is a rather simple request, but to be honest, I’m not that familiar with scripting, I usually try to find ready scripts and edit them for my needs. I have tried to find something on the forum, but with every search I got 300+ pages of results, and I have checked only about 15 of them.
I am trying to build a script that starts with a window where the user can choose an option, based on that option a script should run. This is what I have so far:
set Choice to choose from list of {"Option 1", "Option 2", "Option 3", "Option 4", "Option 5", "Option 6", "Option 7"} with prompt "Choose Option"
on processChoice(Choice)
if Choice is "Option 1" then
-- RUN SCRIPT
else if Choice is "Option 2" then
-- RUN SCRIPT
else if Choice is "Option 3" then
-- RUN SCRIPT
else if Choice is "Option 4" then
-- RUN SCRIPT
else if Choice is "Option 5" then
-- RUN SCRIPT
else if Choice is "Option 6" then
-- RUN SCRIPT
else if Choice is "Option 7" then
-- RUN SCRIPT
end if
end processChoice
“RUN SCRIPT” will run a script that opens mail.app and create a new message with predefined text. The whole reason for this script is that Mail Stationary doesn’t work. These are currently seven short scripts, which work perfectly fine, so I don’t need help with them, but I’d like to insert them into one script to make it more comfortable for the users.
What happens now is that I get the list window, where I can choose the different options, but when I click “OK”, it just closes; when it’s running in AppleScript Editor, it shows the name of the option in the Result window.
My question is: How can I get this script to run the proper script based on the input made in the window? I’d prefer to insert the script code into one big script, but if the only option is to run an external script, that would be acceptable too.
Many thanks for your help in advance.