Series 3700A System Switch/Multimeter Reference Manual Section 11: TSP command reference3700AS-901-01 Rev. D/June 2018 11-345Example 1myTest8 = script.new("display.clear() display.settext('Hello from myTest8')", "myTest8")myTest8()Creates a new script referenced by the variable myTest8 with the name "myTest8".Runs the script. The instrument displays "Hello from myTest8".Example 2autoexec = script.new("display.clear() display.settext('Hello from autoexec')", 'autoexec')Creates a new autoexec script that clears the display when the instrument is turned on and displays "Hellofrom autoexec".Also seeCreate a script using the script.new() command (on page 10-45)Global variables and the script.user.scripts table (on page 10-44)Named scripts (on page 10-4)scriptVar.save() (on page 11-351)script.newautorun() (on page 11-345)script.newautorun()This function creates a script and enables autorun.Type TSP-Link accessible Affected by Where saved Default valueFunction NoUsagescriptVar = script.newautorun("code")scriptVar = script.newautorun("code", "name")scriptVar The name of the variable that will reference the scriptcode A string that contains the body of the scriptname The name of the scriptDetailsThe name parameter is the name that is added to the script.user.scripts table. If name is notgiven, an empty string is used, and the script is unnamed. If the name already exists inscript.user.scripts, the existing script's name attribute is set to an empty string before it isreplaced by the new script.Note that name is the value that is used for the instrument front panel display. If this value is notdefined, the script is not available from the front panel.You must save the new script into nonvolatile memory to keep it when the instrument is turned off.The script is run automatically immediately after it is created.This command is the same as the script.new() function except that the script is automatically run.