Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ macquery(1M) — A/UX 3.0.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought




macquery(1M) macquery(1M)
NAME macquery - posts a Macintosh alert box to query the user SYNOPSIS macquery [-a] [-c] [-n] [-s] [-ttimeout] resource-file alert-id [parm1 ... parm4] ARGUMENTS -a Posts the alert box exactly as it is defined in the resource file. alert-id Specifies the resource ID number of the alert box you wish to display. -c Posts the alert box as a Caution alert box. -n Posts the alert box as a Note alert box. parm1 ... parm4 Specify up to four parameter strings that are placed in the alert if the value of an alert string has been specified in terms of a special notation. The special notation is in the form of a caret followed by a digit between 0 and 3: ^parmno Rather than display these special notations in the alert box (^0, ^1, ^2, or ^3), macquery displays the associated parameter argument from the command line. (See the discussion of the ParamText call in Inside Macintosh, Volume I, for a lengthier discussion of parameter strings.) resource-file Specifies the resource file in which the alert box is defined. -s Posts the alert box as a Stop alert box. -t timeout Specifies a number of seconds to wait for user input before a default button is selected. The default button must be the first item in the alert definition and is indicated by a bold outline. DESCRIPTION macquery is invoked by shell scripts or commands that do not directly use the Macintosh User Interface Toolbox but still need to present a Macintosh interface when asking the user simple questions or giving the user information. This January 1992 1



macquery(1M) macquery(1M)
command is used to post an alert box that asks a question or supplies information. The alert box can include static text, icons, and QuickDraw pictures but should not include check boxes, radio buttons, editable text fields, or other more complex controls. (See Inside Macintosh, Volume I, for more information about alert boxes and controls.) Typically, the ResEdit utility is used to create alert resource definitions. The command that invokes macquery must supply a resource filename (resource-file) and a resource ID number (alert-id) for an alert resource defined in that file. The alert is posted exactly as it is defined in the resource, unless an option indicates that one of the standard alert icons should also be displayed in the alert box. (See Volume I of Inside Macintosh for a discussion of the various standard alerts.) When the user clicks an enabled button, macquery closes the alert and exits. The exit status indicates which button the user clicked (or that an error occurred). See ``Status Messages and Values'' later in the manual page for more information. EXAMPLES Here is the macquery command line from the /etc/sysinitrc file that helps initialize A/UX. (The value of the $fs variable references a file system that needs to be checked and repaired as necessary by fsck.) /etc/macquery -c /etc/fsck 129 $fs STATUS MESSAGES AND VALUES The exit status is used both to indicate an error and to report which button the user clicked. If the exit status is 1, an error occurred. For example, the Macintosh environment is not running, or the resource file is missing. Diagnostic alert boxes or printed messages are posted. If the exit status is between 201 and 225, the user selected the corresponding item numbered between 1 and 25 in the alert resource. Thus, an exit status of 201 indicates that the default button was selected. Constants named ANSWER_MIN and ANSWER_MAX have been defined for these values in /usr/include/apple/macquery.h for use by C programmers. FILES /etc/macquery Executable file /etc/%macquery 2 January 1992



macquery(1M) macquery(1M)
Resource file /usr/include/apple/macquery.h Header file SEE ALSO Inside Macintosh January 1992 3

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026