Re: Display Dialog
Re: Display Dialog
- Subject: Re: Display Dialog
- From: Michelle Steiner <email@hidden>
- Date: Fri, 27 Feb 2004 15:18:14 -0700
On Feb 27, 2004, at 2:40 PM, Ruby Madraswala wrote:
Any suggestions will be appreciated.
set button_name to "OK"
set code_list to {}
repeat until button_name is "Exit"
set user_stuff to (display dialog "Enter standard code" & code_list
default answer "" buttons {"Exit", "OK"} default button "OK")
set button_name to button returned of user_stuff
set std_code to text returned of user_stuff
copy return & std_code to end of code_list
-- see my comment at the end of this message.
If button_name is "OK" then
-------------write code to a file-----------
end if
end repeat
Actually, since the list of codes is retained in code_list, it can all
be written to a file (stripping the returns if necessary) after the
Exit button is pressed, instead of appending each code to the file on
each iteration.
This was done on Panther with AS 1.9.3; it automatically expands the
dialog as more lines are added to it. Earlier versions (I'm not sure
at which point this changed) kept a fixed-size dialog, so this would
not work well with those versions.
-- Michelle
--
"To announce that there must be no criticism of the president, or that
we are to stand by the president right or wrong, is not only
unpatriotic and servile, but is morally treasonable to the American
public." --Teddy Roosevelt
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.