script

Specifies the contents of an object script.

# Metadata

Platforms: desktop, server, mobile OS: mac, windows, linux, ios, android Introduced: 1.0 Security:

# Syntax

set the script of object to string

# Examples

set the script of button 2 to empty -- clear out the script

set the script of field "Get It" to field "Get It Script"

# Description

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.

# Tags

# See

- **command:** remove script, edit - **glossary:** object - **property:** script