RunScript(guid As String)

 

Run a XojoScript identified by guid.

 

XojoScripts are stored in database table scripts and uniquely identified by a guid string, like 74855E25-5542-4B9D-B821-04C414425526. Using the RunScript method, we can launch one script from various locations, like from the Script menu, from the Script toolbar button or from any context menu where it makes sense to implement it.

  

Parameters:

 

Name

Type

Description

guid

String

The globally unique identifier of the XojoScript.

Example: 74855E25-5542-4B9D-B821-04C414425526

 

Available in:

 

WindowMain

WindowLink

YES

YES

 

 Used in:

 

XojoScript Name

GUID

print participants list, from eventslist

EC2D6DAE-B89D-43AC-A663-B9A09ECB501B

Record update in databox

4A25A881-0947-45EF-B691-B81900C1ACEE

Record insert in databox

C05B0C75-E449-4752-AB16-65693A6A00A1

Print participants list from main menu

2E450856-90F7-41A1-861D-9C32494CBF1B

Save As Excel file : invoice list from Script Menu

43295188-D3E6-450D-965C-BB53B84AE087

Save As Excel file : invoice list from Eventlist context menu

4835485A-F6A2-4B02-9FB5-7697DF24A507

 

Hint: You can find more references to XojoScripts which make use of this function by sending the following SQL statement to the database: Select id,GUID, ScriptName,ScriptCode from im_scripts where ScriptCode Like '%RunScript%'

 

Example XojoScript:

 

If (IsInsertMode = 1) Then

If GetActiveModul = "addresses" Then

 

Dim company As String = GetText("imTF_adr_OrganizationName")

Dim lastname As String = GetText("imTF_adr_LastName")

 

// Either one must be filled out, abort if empty

If lastname = "" And company = "" Then

MsgBox("Please fill out either 'Lastname' or 'Company'." + EOL + EOL + "This record has not been saved.")

 

// Cancel saving of data

AbortInsert("TRUE")

Return

End If

 

Dim label As String = GetText("imTA_adr_Label")

Dim salutation As String = GetText("imTF_adr_Salutation")

Dim linkbox As String = GetText("imTF_adr_Linkbox")

 

// Generate label, salutation and linkbox text if either one is missing

If label = "" Or salutation = "" Or linkbox = "" Then

 

// Script to generate label, salutation and linkbox text

RunScript("74855E25-5542-4B9D-B821-04C414425526"

 

End If  // label = ""

End If // ActiveModul = addresses

End If // IsInsertMode