![]() |
![]() |
![]() |
|
![]() | |
![]() |
![]() |
![]() |
![]() |
![]() |
Log In | Not a Member? |
Support
![]() |
![]() |
SYNTAX
Format [window1] [window2]… [[-a attributes] [-f fontName] DESCRIPTION The Format command allows you to set the format of one or more windows. It is the scriptable form of the Format menu item in the Edit menu. As such, its options, which control such things as font and tab size, correspond to the items in the Format menu item's dialog.
Note In addition to setting its format, you can use this command to view a window's current format setting. See the Output section for a description of this. INPUT None OUTPUT None, unless you do not specify any options (except -x). In this case, the format settings of the current window are written to standard output. Note that these format settings normally appear in the form of Format commands that can be selected and executed. If you specify -x, these settings appear as fields of values instead. ALIAS RESOLUTION This command resolves Finder aliases that are part of a partial or complete pathname substituted for the window name. The resolved pathname must specify the name of an open window. Note that using a shell variable to designate a window is usually faster than requiring MPW to resolve a Finder alias. STATUS
Format can return the following status codes:
PARAMETERS window1 [window2]… Specifies one or more windows to be formatted. If you do not specify any windows, Format uses the target window. OPTIONS -a attributes
Sets or clears the auto-indent, invisibles, and auto-scrolling states. The attributes parameter is a string composed of the characters in the following list. Any attribute that is not listed remains unchanged.
Note that uppercase letters turn on the attribute and lowercase letters turn it off. -f fontName Changes the font in the specified windows to fontName. -l language
Sets the syntax colorization in the specified windows to language.
The language must be specified as a string that matches those displayed in the list in the Format
dialog, which are based on the resource names of the 'Sods' resources
contained in the shell. The "official" language specifications currently recognized are:
There is also a translation resource ('STR#'(256)) that can be used to supply language "aliases" for ease of use. The individual entries in the resource must be formatted as: alias=OfficialName
The default set of supplied aliases are:
To "unset" a language for a window (that is, allow the logic in the shell to determine the syntax colorization to use based on the filename), use the Default language argument to the -l option. To disable syntax colorization for a file, use the None language argument to the -l option. -s fontSize Changes the font size in the specified windows to fontSize. -t tabSize Changes the tab size in the specified windows to tabSize. -x formatting Displays the current format settings in fields, where formatting determines the order in which the fields appear. Normally Format displays settings in the form of Format commands when no other options are specified.
The formatting parameter is a string composed of the following letters in any order. In the output, fields are placed in the order specified, separated by spaces.
Note that an error message occurs if you specify any other option in conjunction with this option. EXAMPLES The following command line sets the auto-indent, font, and tab size in the target window. The font size and invisible settings are not changed. Format "{target}" -a A -f Monaco -t 8 This example changes the font size in MyWindow to 12 point: Format -s 12 MyWindow A Format statement with no options, such as Format "{Target}" displays the current format of the window. The output appears as follows: Format -f Monaco -s 9 -t 4 -a Ail 'HD:Sources:Test.c' Using -x, the command line Format -x tsf displays only the values of the specified options: 8 9 Monaco
|