Is a selection list possible

Is there a way to create a selection list dialog with Applescript (aside from installing 3rd party software)? TIA.

set myDestinations to {“a”, “b”, “c”, “d”, “e”, “f”}
set myDestListResponse to (choose from list myDestinations with prompt “Please pick a destination…” OK button name “Set” without multiple selections allowed and empty selection allowed)

This example requires the user to select one and only one item. Change the “without multiple selections allowed and empty selection allowed” part to your liking.

Cool! Thanks a bunch. :smiley:

Not quite as cool as I first thought. I am having a problem handling the cancel button. I cannot come up with logic that does not get a runtime error to check the button returned.

I thought “Cancel” was supposed to automatically cancel the script but in this instance that is not the case.

gw1500se:choose from list returns false if the user clicks the cancel button, otherwise a list. you can handle the returns like this:

set userChoice to choose from list {1, 2, 3}
if userChoice is false then
	--handle the list here
end if