System SourceMeter® Instrument Reference Manual Section 7:
2600BS-901-01 Rev. C / August 2016 7-179
script.newautorun()
This function is identical to the script.new() function, but it creates a script with the autorun attribute set to
"yes".
Type TSP-Link accessible
Affected by Where saved Default value
Usage
scriptVar = script.newautorun(code)
scriptVar = script.newautorun(code, name)
The name of the variable that will reference the script
A string containing the body of the script
The name of the script
Details
The script.newautorun() function is identical to the script.new()function, except that the
autorun attribute of the script is set to yes. The script is also automatically run immediately after it is
created.
Example
NewAuto = script.newautorun("print('Hello from new auto run command')",
'NewAuto')
print(NewAuto.autorun)
Creates a new script called NewAuto that automatically has the autorun attribute set to yes after it is
created. The name attribute's value is set to "NewAuto".
Output:
Hello from new auto run command
yes
Also see
Create a script using the script.new() command (on page 6-39)
Global variables and the script.user.scripts table (on page 6-37)
Named scripts (on page 6-4)
script.new() (on page 7-178)
scriptVar.save() (on page 7-186)