• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Display Dialog
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >Display Dialog (From: "Ruby Madraswala" <email@hidden>)

  • Prev by Date: Re: AS/FMP: a list of fewer than two records
  • Next by Date: Re: URL Access
  • Previous by thread: Display Dialog
  • Next by thread: Terminal Scripting
  • Index(es):
    • Date
    • Thread