Livecode Wiki

Every object has properties. You can see those properties by using the Property Inspector and make any changes. For example, by using the Property Inspector, you can make a standard button into precisely the type of button you need for your program.

You can also change the properties of an object in script code by using the set command. You cannot use the put command to give a property a new value. Also, anytime you refer to a property, use the word "the" in front of the property name.

set the foregroundcolor of button "test" to red

If your script refers to the object that contains it, you can use the keyword me. So you can write:

set the backgroundcolor of me to blue

You might have to specify the object that owns the property and maybe the object that owns it, etc. It is better to be extra clear so that LiveCode knows exactly which property of which object to change. No errors to correct.

For example:

set the label of button "Fred" of card "George" of stack "Hellen" to "Rat"

You can refer to an object by its name or by its ID. Since the name is given by the programmer, you have to make sure it is unique. If two or more objcts have the same name, LiveCode will always choose the first object in the object hierarchy with that name. Fortunately every object always has a unique ID number (automatically created by LiveCode), so you can use that instead. See the next example:

set the borderColor of field "MaximumStarch" of this card of this stack to black
set the autoHilite of button ID 1734 to true

The first example above refers to a field using its name. The second example above refers to a button by its ID. Remember to always specify they type of object before the ID number. You can always find the ID number because it is shown in the Property Inspector window title.

Property list[]

The following are properties of objects. Please help us to complete this list: