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
|