Language Guide
CHAPTER 4
Commands
Command Definitions 91
Since the Scriptable Text Editor returns position of front window as a
list of two integers, the preceding example copies the first item in the list to x
and the second item in the list to y.
Patterns copied with the Copy command can also be more complex. Here’s
an example:
set x to {8, 94133, {firstName:"John", lastName:"Chapman"}}
copy x to {p, q, {lastName:r}}
(* now p, q, and r have these values: p = 8
q = 94133
r = "Chapman" *)
As this example demonstrates, the properties of a record need not be given in
the same order and need not all be used when you copy a pattern to a pattern,
as long as the patterns match.
The use of the Copy command with patterns is similar to the use of the Set
command with patterns. For information about the Set command, see page 113.
NOTES
For more information about using the Copy command to create or change the
values of variables, see “Variables,” which begins on page 150.
If you use the Copy command without parameters and there is no selection to
be copied, the application does not change the contents of the Clipboard.
When copying objects between applications via the Clipboard, you must
use the Activate command to make the receiving application active before
attempting to paste from the Clipboard.
ERRORS
Error
number Error message
–1728 Can't get <reference>.
–10006 Can't set <destination> to <source>.