• 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: JavaScript for automations: bug or correct behavior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JavaScript for automations: bug or correct behavior


  • Subject: Re: JavaScript for automations: bug or correct behavior
  • From: David Steinberg <email@hidden>
  • Date: Mon, 19 Jan 2015 15:34:18 -0800

Hi Deivy,

Though AppleScript and JavaScript differ when indexing into their own arrays, the display dialog standard addition treats 1 as the beginning of an array, so 0 won't work.

- David

> On Jan 19, 2015, at 11:21, Deivy Petrescu <email@hidden> wrote:
>
>
> This JSA script
> <script>
> app=Application.currentApplication()
> app.includeStandardAdditions=true
> dd=app.displayDialog('Please enter your name: ', {buttons:["Cancel", "OK"], defaultButton: 1, defaultAnswer:''}).textReturned
> dd
> </script>
>
> poses a dialog where “Cancel” is the default button.
> Correct behavior in AS, but JS starts its counting from 0, thus button 1 should be “OK”.
> For other arrays, JSA behaves as expected.
>
> May be my question is if you are using JSA would that be the preferred behavior?
> Thanks
>
> Deivy Petrescu
> email@hidden
>
>
>
>
> _______________________________________________
> 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


 _______________________________________________
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


  • Follow-Ups:
    • Re: JavaScript for automations: bug or correct behavior
      • From: Deivy Petrescu <email@hidden>
References: 
 >JavaScript for automations: bug or correct behavior (From: Deivy Petrescu <email@hidden>)

  • Prev by Date: Apple Quality
  • Next by Date: Re: JavaScript for automations: bug or correct behavior
  • Previous by thread: JavaScript for automations: bug or correct behavior
  • Next by thread: Re: JavaScript for automations: bug or correct behavior
  • Index(es):
    • Date
    • Thread