Section 7: TSP command reference
2606B System SourceMeter® Instrument Reference Manual
7-164
2606B-901-01 Rev. B / May 2018
script.newautorun()
This function is same as the
script.new()
function, except that that autorun is enabled.
Type
TSP-Link accessible
Affected by
Where saved
Default value
Function
No
Usage
scriptVar
= script.newautorun(
code
)
scriptVar
= script.newautorun(
code
,
name
)
scriptVar
The name of the variable that will reference the script
code
A string that contains the body of the script
name
The name of the script
Details
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)
print(NewAuto.name)
Creates a new script called
NewAuto
that automatically has the autorun attribute set to yes after it is created.
The
name
is set to
"NewAuto"
.
Output:
Hello from new auto run command
yes
NewAuto
Also see
Create a script using the script.new() command
(on page 6-38)
Global variables and the script.user.scripts table
(on page 6-4)
(on page 7-163)
(on page 7-166)
(on page 7-169)
script.restore()
This function restores a script that was removed from the run-time environment.
Type
TSP-Link accessible
Affected by
Where saved
Default value
Function
No
Usage
script.restore(
name
)
name
The name of the script to be restored