Livecode Wiki

Specifies the contents of an object's script.Syntax:

set the script of <object> to <string>


set the script of button 2 to empty -- clear out the script
set the script of field "Get It" to field "Get It Script"

Use the script property to examine or change an object's script from inside a LiveCode statement, instead of using the script editor.

An object's script is the code that controls that object. All of an object's handlers are part of its script property.

You can view and change a script directly by selecting the object and choosing Object menu. Use the script property within a handler to check the contents of a script, or change the script.

LiveCode compiles the script immediately after it is set. This means that it is not possible to write a self-modifying handler, because the currently-executing handler would have to be changed and re-compiled while it was running.

See also: script (property),