(self, prompt, timeout=None, args=(), buttons=None)
return ret[0]
Show the user a dialog with OK button.

    Do not put user-supplied data into the prompt value. Use string formatting
    and put the values into args.

    Args:
      prompt: str, the prompt to supply to the user
      timeout: int, optional, number of seconds to wait before giving up
      args: list, optional, arguments to supply to Execute().
      buttons: list of strs, optional, default "OK", buttons to display
    Returns:
      str, the name of the button pressed, in this case "OK"
    Raises:
      AppleScriptTimeoutError: dialog timed out before user action
Show the user a dialog with OK button.
Show the user a dialog with OK button .
def DialogDisplay(self, prompt, timeout=None, args=(), buttons=None):
    """Show the user a dialog with OK button.

    Do not put user-supplied data into the prompt value. Use string formatting
    and put the values into args.

    Args:
      prompt: str, the prompt to supply to the user
      timeout: int, optional, number of seconds to wait before giving up
      args: list, optional, arguments to supply to Execute().
      buttons: list of strs, optional, default "OK", buttons to display
    Returns:
      str, the name of the button pressed, in this case "OK"
    Raises:
      AppleScriptTimeoutError: dialog timed out before user action
    """
    if buttons is None:
      buttons = ['OK']
    opts = [
        'buttons {"'
        + '","'.join([self._EscapeScriptValue(b) for b in buttons])
        + '"}',
    ]
    if timeout is not None:
      opts.append('giving up after %d' % timeout)
      base_script = self.BUTTON_TIMEOUT_DIALOG
    else:
      base_script = self.BUTTON_DIALOG

    osa_script = base_script % (self._EscapeScriptValue(prompt), ' '.join(opts))
    ret = self.ExecuteAndUnpack(osa_script, 'sb', *args)

    # The BUTTON_*DIALOG scripts return 2 values, the button text
    # and a boolean for whether timeout occured or not.
    if ret[1]:
      raise AppleScriptTimeoutError(ret[0])

    return ret[0]
def DialogDisplay ( self , prompt , timeout = None , args = ( ) , buttons = None ) : if buttons is None : buttons = [ 'OK' ] opts = [ 'buttons {"' + '","' . join ( [ self . _EscapeScriptValue ( b ) for b in buttons ] ) + '"}' , ] if timeout is not None : opts . append ( 'giving up after %d' % timeout ) base_script = self . BUTTON_TIMEOUT_DIALOG else : base_script = self . BUTTON_DIALOG osa_script = base_script % ( self . _EscapeScriptValue ( prompt ) , ' ' . join ( opts ) ) ret = self . ExecuteAndUnpack ( osa_script , 'sb' , * args ) # The BUTTON_*DIALOG scripts return 2 values, the button text # and a boolean for whether timeout occured or not. if ret [ 1 ] : raise AppleScriptTimeoutError ( ret [ 0 ] ) return ret [ 0 ]