The string-to-object-name and object-name-to-string conversions discussed above are performed in a less obvious manner when a name specifies ancestry. (Ancestry is an object attribute.)
ESL can convert an object name with ancestry, such as
PanicButton in Panel, to a string. For example, you can specify:
string variable TempName
region Panel size 50 100 at position 100 200 key PanicButton at position 50 50 in Panel response to start
copy PanicButton in Panel to TempName
When ESL executes the copy statement, it converts the name PanicButton in Panel to a string, and stores the value in the variable TempName. The value stored in TempName is not, however, "PanicButton in Panel", but is another string that is a more convenient representation for ESL: "Panel/PanicButton". You can then use the variable TempName in statements that require an object name as a value; for example:
make TempName visible
At this point, the value of TempName is converted back to the name of the object, PanicButton in Panel, and this object is made visible.
The following example is incorrect:
response to ...
copy "PanicButton in Panel" to TempName
...
disable TempName # WRONG
In this example, ESL does not disable the object PanicButton in Panel. The string, "PanicButton in Panel", is not equivalent to the name, PanicButton in Panel, and therefore cannot be converted. Instead, you would specify:
response to ...
copy "Panel/PanicButton" to TempName