7.6: Property Arrays using the Properties Property

Properties
プロパティを使ったプロパティのアレイ

In addition to retrieving individual object properties, you can retrieve or set an entire set as an array using the
properties property. You can use this to edit, copy, export or import properties.

各オブジェクトのプロパティの設定方法には更にpropertiesプロパティを使ったアレイによる方法があります。この方法を使えば、プロパティを編集したり、複製したり、或いは入出力したりできます。

set the properties of object to propertiesArray
put the properties of object into propertiesArray

The
properties of an object is an array containing that object's significant built-in properties.

あるオブジェクトのpropertiesプロパティは、そのオブジェクト固有の組み込みプロパティを含むアレイ(配列)です。

put the properties of button 1 into myArray
set the properties of last player to the properties of player "Example"


Tip: This example handler shows you how to write the properties of an object to a text file.

秘訣:次のハンドラは、あるオブジェクトのプロパティをテキスト・ファイルとして書きだす例です。

on mouseUp
put the properties of button 1 into tPropertiesArray
combine tPropertiesArray using return and "|"
ask file "Save properties as:"
if it is not empty then put tPropertiesArray into URL ("file:"&it)
end mouseUp

In this example, each property name will be written followed by the “|” character and the property value and then a return character.

上の例では、各プロパティ名の後に「|(縦棒)」で区切られたプロパティの値が表示され、最後に改行コードが表示されます。

For more details, see the
properties property in the Transcript Dictionary.

詳細は、トランスクリプト辞書のをproperties propertyご覧下さい。