Scripting Additions Guide
Table Of Contents
CHAPTER 2
Scripting Addition Commands
Command Definitions 17
PARAMETERS
promptString The prompt to be displayed in the dialog box. The prompt can
be up to 255 characters long, but the standard dialog box has
room for only about 40 characters. If you omit the with
prompt parameter, no prompt is displayed.
Class: String
Default Value: (no prompt)
listOfTypes A list of the file types of the files to be displayed in the dialog
box. Each string is a four-character code for the file type, such as
"TEXT", "APPL", "PICT", or "PNTG". If you omit the of
type parameter, all files are displayed.
Class: List of strings; each string is a four-letter code
Default Value: (all file types displayed)
RESULT
A reference of the form file "Disk:Folder1:Folder2:...:Filename" for the file
specified by the user, if any.
EXAMPLE
choose file with prompt "Please choose a file:" of type ¬
{"TEXT", "APPL"}
open result
NOTES
If the user clicks Cancel in the Choose File dialog box, AppleScript returns error
number –128. If you want your script to continue after the user clicks Cancel,
you must include an error handler. For information about Try statements
and error handlers, see Chapter 7, “Control Statements,” of the AppleScript
Language Guide.
ERRORS
Error
number Error message
–108 Out of memory.
–128 User canceled.