« Back to Product

Documentation

RegisterScript

Require: IP-Symcon >= 4.0

 int RegisterScript (string $Ident, string $Name, string $Contents, int $Position) 

Parameters

Ident

Ident of the script

Name

Name of the script

Contents

Content to be entered in the script.
Default == "<?php

//Autogenerated script"

Position

Position in the object tree and thus also in the visualization.
Default == 0

Returns

Returns the ObjectID of the script that has been created or that already exists

Description

Creates a script with the Ident Ident, name Name, content Content and the position Postion, if the specified Ident does not already exist.
In both cases, the ObjectID of the script that has been created or that already exists is returned.

Warning

The content of Content is overwritten every time, always guaranteeing the correct content, even after changes. For scripts which are to be processed, it is recommended to use a configuration form with SelectScript-selection

Example

$scriptID = $this->RegisterScript("TextSxript", "My TestScript");
Any questions?