to
set
propertyName to
variableName
statementList
end
set
The to set
handler defines the behavior of a user-defined object when property propertyName is set. When a script sets the
propertyName of
a user-defined object, the statements in the corresponding to set
handler are executed. The new value of the property is passed through the local variable variableName.
Unlike parameters to an on
or a function
handler, which are converted to string
s unless declared otherwise, the parameter to a to set
handler is kept as-is, as if declared as a variant
.
This structure is only valid inside an object type
structure.