Language Guide

CHAPTER 4
Commands
90 Command Denitions
is a reference to the copied object; however, if the command does not include
parameters, there is no result.
Class: Varies
EXAMPLES
This example copies a string to the variable myOccupation:
copy "writer" to myOccupation
This example copies the value of a reference to the variable x:
copy word 1 of front document of app "Scriptable Text Editor" to x
This example makes a copy of a word, and then inserts it at the beginning of
the fourth paragraph:
tell application "Scriptable Text Editor"
copy word 1 to beginning of paragraph 4
end tell
The next example copies a word to the Clipboard and then pastes it from the
Clipboard to the insertion point after the tenth paragraph.
tell application "Scriptable Text Editor"
select word 1 of document "Test"
copy
select insertion point after paragraph 10 of document "Test"
paste
end tell
In addition to copying a value to a single variable or object, you can copy
patterns of values to patterns of variables. For example, this script copies
the position of the front window to a list of two variables:.
tell application "Scriptable Text Editor"
copy position of front window to {x, y}
end tell