8.1.26.22 Worksheet::SetScript

It is recommended that you switch to the originpro package. PyOrigin is primarily for users who need to work with Origin version prior to 2021.

Description

Worksheet script setting

Syntax

SetScript(Script, Ctrl = WKSC_CNTL_IMPORT, Range = NULL)

Parameters

Script
labtalk script to set
Ctrl
bits to control the usage of the script, see WKSC_CNTL_IMPORT etc in oc_const.h
RangeCheckChange
Optional range string that will trigger this script to run when data inside the range is modified

Return

None

Examples

#Set Worksheet script in the Book1. 
import PyOrigin
wks=PyOrigin.FindWorksheet('Book1')
Script = "wksn$=%H;\r\nwin -T plot;\r\nplotxy [wksn$]1!(1,2)\r\n";
dwCntrl = 1|1
#display the first 4 rows
wks.SetScript(Script, dwCntrl, "[Data1]1!1:5")