6.1.3:Using
Chunks with Properties
プロパティでチャンクを使う
You can
use chunk
expressions to read
portions of
a property
(such as the
script
property). However,
since you change a property with the set
command rather than
the put
command, you
can't
use a chunk
expression to change
a part of a
property's value.
スクリプト・プロパティのようなプロパティの一部分を読むのにもチャンク表現式を使うことができます。とは言え、プロパティの変更には、putコマンドではなくsetコマンドを使うため、プロパティの値の一部分を変更するにはチャンク表現式は使えません。
Instead, put
the property value
into a variable, use the chunk expression to change the
variable, then set
the property to the
variable's contents. The following example shows how to
change the third line of an object's script
property:
その代わり、プロパティの値を変数に入れる(putする)には、変数を変更するためにチャンク表現式を使い、次にプロパティをその変数の内容に設定(set)します:
put the
script of me into tempScript
put "-- Last changed by Jane" into line 3 of tempScript
set the script of me to tempScript