• 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: problem using display dialog in mavericks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem using display dialog in mavericks


  • Subject: Re: problem using display dialog in mavericks
  • From: "koenig.yvan" <email@hidden>
  • Date: Tue, 04 Feb 2014 17:55:37 +0100


Le 04/02/2014 à 17:08, António Queirós <email@hidden> a écrit :

Hello,

I'm developing some script to help people with visual empairements to turn osx more accessible. In ML I could use "display dialog" to display messages on screen. Unfortunately this command doesn't function asin Mavericks as it did in Ml:
What's the differences. How can I do the same in this OS?
When I say "it doesn't function" is when I export the script to app.

Every help will be welcome.

Your sincerely,

António Queirós


I guess that you are using Display dialog to ask the user to type an answer to a question, not only to click a button.

If I guess correctly, it just prove that you are violating the rule defined by Apple for years.

Display dialog returns a record :

{button returned : theButton, text returned : the text entered}

For years, the record used the alternate layout :

{text returned : the text entered, button returned : theButton}

Apple explained « en long, en large et en travers » that we can't trust upon the order of properties embedded in a record.
Alas, many users refused to take care of that and continued to code like pigs using :

copy the result as list to {text_returned, button_pressed}

I don't know if it's deliberate but, at last, Apple changed the order of the property embedded in the returned record.

This way, scripts correctly written behave flawlessly and others fail.

Nigel Garvey which code correctly posted :

display dialog "enter something:" default answer theDefaultString buttons {"skip", "set"} default button 1
set {text returned:text_returned, button returned:button_pressed} to result 

As I'm not so expert than Nigel I posted an alternate correct scheme :

set the_result to display dialog "azerty" default answer "qwerty"
set button_returned to button returned of the_result
set text_returned to text returned of the_result

Choose your preferred version.


Yvan KOENIG (VALLAURIS, France) mardi 4 février 2014 17:51:38


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >problem using display dialog in mavericks (From: António Queirós <email@hidden>)

  • Prev by Date: problem using display dialog in mavericks
  • Next by Date: problem with display dialog
  • Previous by thread: problem using display dialog in mavericks
  • Next by thread: Re: problem using display dialog in mavericks
  • Index(es):
    • Date
    • Thread