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

MPW Command Reference


Paste

Built-in

SYNTAX

Paste selectionExpression [window] [-c count]

DESCRIPTION

The Paste command finds selectionExpression in the specified window and replaces its contents with the contents of the Clipboard.

INPUT

None

OUTPUT

None

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

Paste can return the following status codes:

0

at least one instance of the selection found

1

syntax error

2

any other error

PARAMETERS

selectionExpression

Specifies the text you want to replace in a selection expression. Selection expressions include regular expressions and certain MPW-specific symbols.

window

Specifies the window in which the text of selectionExpression can be found. If you omit the window parameter, Paste defaults to the target window. Note that it is an error to specify a window that does not exist.

OPTIONS

-c count

Replaces up to count instances of the selection with the contents of the Clipboard. Normally Paste assumes the count is 1. As a convenience you can use the infinity symbol (∞) to replace all instances of the selection.

EXAMPLES

In this example, the command line replaces the first instance of the word Begin with the contents of the Clipboard. A replacement such as this is useful for changing the case of a word, such as changing Begin to BEGIN, or for replacing a word with another word, such as changing moof to dogcow.

Paste /Begin/

The following command line replaces the current selection with the contents of the Clipboard. This command is the same as the Paste menu item, except that it operates on the target window rather than the active window.

Paste §

The following command line selects everything from the next BEGIN to the following END in the Source window and replaces it with the contents of the Clipboard.

Paste /BEGIN/:/END/ Source

SEE ALSO

Copy

Cut

Replace

 
 


Last Updated July 2000