Re: Display Dialog
Re: Display Dialog
- Subject: Re: Display Dialog
- From: "Gary (Lists)" <email@hidden>
- Date: Thu, 14 Apr 2005 15:53:01 -0400
Ruby Madraswala wrote [4/14/05 10:05 AM]:
> Set user_stuff to display dialog "Enter Project Number:" default answer " "
> buttons {'FS', "CR", "PP", "NZ", "HD", "SN", "Exit"} default button "FS"
> Set button_name to button returned of user_stuff
'display dialog' has a three-button limit. It's not really the sort of
interface you want for this kind of choosing.
However, 'choose from list' is just what you need.
> I get error message "parameter error". {'FS', "CR", "Exit"} works fine.
I note that there is a difference in the quotes you have around the FS
entry. But, you know there's a button limit anyway, so let's move on.
> What I want is the users to enter project number and select a project type. Is
> there another way to handle this?
set projectTypes to {"FS", "CR", "PP", "NZ", "HD", "SN"}
set typeList to --<REMOVE_LINEBREAK>--
(choose from list projList with prompt "Please select a project type...")
--> {"NZ"}
This command is also easier to deal with concerning the cancel status.
Unlike display dialog, when the user clicks 'Cancel' (automatically added,
along with 'OK'), the command returns a boolean 'false' (no quotes).
When a choice is made, the result is a list (even if only one item is
selected -- you can use "with multiple selection allowed" or some similar
construct...I can't recall right now.)
Also notice that it's kind of best (the point?) to set the returned result
to some variable. In the case of my tested example above, the variable
'typeList' would now hold the _list_ of the project type chosen.
If you want just the "inside" value of the single list item, then you can:
set thisProjectType to item 1 of typeList
HTH, Ruby.
--
Gary
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden