(
      self, prompt, timeout=None, hidden=False, default=None, args=())
return ret[0]
Prompt the user for a string input via a GUI dialog.

    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
      hidden: bool, optional, if true the input field is obfuscated
      default: str, optional, default value to place into input field
      args: list, optional, arguments to supply to Execute().
    Returns:
      str
    Raises:
      AppleScriptTimeoutError: dialog timed out before user action
Prompt the user for a string input via a GUI dialog.
Prompt the user for a string input via a GUI dialog .
def DialogGetString(
      self, prompt, timeout=None, hidden=False, default=None, args=()):
    """Prompt the user for a string input via a GUI dialog.

    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
      hidden: bool, optional, if true the input field is obfuscated
      default: str, optional, default value to place into input field
      args: list, optional, arguments to supply to Execute().
    Returns:
      str
    Raises:
      AppleScriptTimeoutError: dialog timed out before user action
    """
    opts = []

    if timeout is not None:
      opts.append('giving up after %d' % timeout)
      base_script = self.GENERIC_TIMEOUT_DIALOG
    else:
      base_script = self.GENERIC_DIALOG

    if hidden:
      opts.append('with hidden answer')

    if default is not None:
      opts.append('default answer "%s"' % self._EscapeScriptValue(default))
    else:
      opts.append('default answer ""')

    osa_script = base_script % (self._EscapeScriptValue(prompt), ' '.join(opts))

    # The GENERIC_*DIALOG scripts return 2 values, the button text
    # and a boolean for whether timeout occured or not.
    ret = self.ExecuteAndUnpack(osa_script, 'sb', *args)

    if ret[1]:
      raise AppleScriptTimeoutError(ret[0])

    return ret[0]
def DialogGetString ( self , prompt , timeout = None , hidden = False , default = None , args = ( ) ) : opts = [ ] if timeout is not None : opts . append ( 'giving up after %d' % timeout ) base_script = self . GENERIC_TIMEOUT_DIALOG else : base_script = self . GENERIC_DIALOG if hidden : opts . append ( 'with hidden answer' ) if default is not None : opts . append ( 'default answer "%s"' % self . _EscapeScriptValue ( default ) ) else : opts . append ( 'default answer ""' ) osa_script = base_script % ( self . _EscapeScriptValue ( prompt ) , ' ' . join ( opts ) ) # The GENERIC_*DIALOG scripts return 2 values, the button text # and a boolean for whether timeout occured or not. ret = self . ExecuteAndUnpack ( osa_script , 'sb' , * args ) if ret [ 1 ] : raise AppleScriptTimeoutError ( ret [ 0 ] ) return ret [ 0 ]