Tools: MPW
Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Support

MPW Command Reference


Editor Primitives

Built-in

SYNTAX

primitiveName [[-count number] [window]]

DESCRIPTION

The term editor primitives covers 38 different commands that can be used to select, move, or delete text within the MPW shell. You can specify the window you want the primitive to act upon, which makes editor primitives useful in scripts. The editor primitives are grouped as shown below.

Select Text

Move Text

Delete Text

SelectCharLeft

MoveCharLeft

DeleteCharLeft

SelectCharRight

MoveCharRight

DeleteCharRight

SelectWordLeft

MoveWordLeft

DeleteWordLeft

SelectWordRight

MoveWordRight

DeleteWordRight

SelectStartOfLine

MoveStartOfLine

DeleteStartOfLine

SelectEndOfLine

MoveEndOfLine

DeleteEndOfLine

SelectStartOfFile

MoveStartOfFile

DeleteStartOfFile

SelectEndOfFile

MoveEndOfFile

DeleteEndOfFile

SelectLineUp

MoveLineUp

 

SelectLineDown

MoveLineDown

 

SelectPageUp

MovePageUp

 

SelectPageDown

MovePageDown

 

SelectHalfPageUp

MoveHalfPageUp

 

SelectHalfPageDown   

MoveHalfPageDown   

 

 

ScrollHalfPageUp

 

 

ScrollHalfPageDown

 

In general, the primitives do what their names imply. However, there are variations among primitives with regard to their treatment of blank lines and preexisting selections. In some cases, the action with respect to a preexisting selection depends on whether the selection was made manually or by the action of a previous primitive. We recommend that you check the behavior of the primitives before using them in a script.

In addition to being used as independent commands, the editor primitives may also be used as operands for the SetKey command.

INPUT

None

OUTPUT

None

ALIAS RESOLUTION

These commands resolve 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.

PARAMETERS

window

Specifies the window you want the editor primitive to act upon. If you do not specify a window, the primitive acts upon the active window.

OPTIONS

-count number

Repeat the command. The integer number specifies how many times to execute this primitive.

EXAMPLES

The following editor primitive command selects the three lines below the cursor in the window specified by "{target}".

SelectLineDown -count 3 "{target}"

SEE ALSO

SetKey

 
 


Last Updated July 2000