Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

orbdrums

macrumors member
Original poster
Hey all,

Sorry if this post is in the wrong place but I just got culture shock from visiting this website. 🙂

I have a REAL simple script that displays a list of options. The code is below:
Code:
choose from list {"Quick", "iMovie", "Standard", "Programming"} with prompt "Please select load option:"
return the result as string
set v_choice to result
if v_choice is equal to "Quick" then
beep 2
end if
if v_choice is equal to "iMovie" then
tell application "iMovie" to activate
end if
if v_choice is equal to "Standard" then
tell application "StandardLoad" to activate
end if
if v_choice is equal to "Programming" then
tell application "EntertainmentLoad" to activate
end if

beep 4

return

The list works just fine but no action is taken when the choice is selected. In other words, regardless of the choice, there is no apparent action. Any help would be greatly appreciated.

Wow, this site has changed!!!
 
Last edited by a moderator:
You are returning from the script before doing anything. Remove the line 'return the result as string' and move your coercion to the line after it: 'set v_choice to result as string' .
 
Thanks Red! You're suggestion made progress however, I don't know what you mean by "coercion".
 
For whatever reason, you were converting the result of the dialog to a string, so I just moved that from the deleted line.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.