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

MPW Command Reference


Copy

Built-in

SYNTAX

Copy selectionExpression [window] [-c count]

DESCRIPTION

The Copy command finds selectionExpression in the specified window and copies it to the Clipboard, replacing the previous contents of the Clipboard.

Note
To copy files, use the Duplicate command. •

INPUT

None

OUTPUT

None

ALIAS RESOLUTION

A partial pathname or a pathname containing Finder aliases may be substituted for the window name as long as the pathname specifies 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

Copy 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 by selection expression or by marker name the text you want to find. Selection expressions include regular expressions and certain MPW- specific symbols and are usually delimited by slash marks (/ /). If you specify a selection expression, Copy locates the text that matches the literal string or text pattern defined by it.

Specifying a marker name locates the text that has been marked with that name. Since a marker is not a selection expression, marker names should not be enclosed in slash marks (/ /).

window

Specifies the window in which the selection can be found. If you omit the window parameter, Copy uses the target window.

OPTIONS

-c count

Copies up to count instances of the text matched by the selection expression. By default, Copy assumes that count is 1. You can use the ∞ symbol (Option-5) to copy all instances of the selection.

Caution
Only the last instance of the selection remains in the Clipboard. •

EXAMPLES

The following command line copies the first occurrence of the word "Paste" in the Test window to the Clipboard.

Copy /Paste/ Test

The following command line copies the current selection (specified by the § symbol) to the Clipboard. Use the Option-6 key combination to enter the § symbol. The result is similar to that of the Copy command in the Edit menu, except that the action occurs in the target window rather than in the active window.

Copy §

The regular expression /Begin/:/End/ selects everything from the next Begin through the following End. Using this regular expression, the command line

Copy /Begin/:/End/

copies the next instance of this selection in the target window to the Clipboard.

SEE ALSO

Cut

Paste

Clear

 
 


Last Updated July 2000