The answer Command

Syntax

answer <expression>
answer <expression> with <expression> or <expression>

Description

The answer command displays a browser dialog.

In its simple form, it calls alert() with the given message.

With the with ... or ... form, it calls confirm() and places the chosen label into it. If the user clicks OK, it is set to the first choice; if the user cancels, it is set to the second choice.

Examples

<button _="on click answer 'File saved!'">Save</button>

<button _="on click
  answer 'Save changes?' with 'Yes' or 'No'
  if it is 'Yes'
    log 'saving...'
  end
">Confirm</button>