Error getting tags :
error 404Error getting tags :
error 404 script | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Expander triangle
set the script of object to string
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
None required
Specifies the contents of an object's script.

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

Additional Comments
Expander triangle

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


The script of an object is a string consisting of handlers and comments.

By default, the script of a newly created object is empty.


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 menuObject Script. Use the script property within a handler to check the contents of a script, or change the script.

Note: When using a standalone application, an object'sscriptproperty may not be set to a string containing more than ten statements. This limit is set by line 1 of the scriptLimitsfunction. (This does not limit scripts that are already written: standalone applications can run scripts of any length. However, if the standalone attempts to change an object'sscriptproperty, and the script contains more than the allowable number of statements, the attempt to set the script causes an error.)

Revolution 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.

User Comments
Expander triangle
User thumbnail
Ed Lavieri
Jul 8, 2009
An additional example that works is:

set the script of btn newName to script of btn "defaultButton"