# Management of Scripts > Symcon documentation · English · generated on 2026-09-26 > Index: https://www.symcon.de/en/llms.txt Source: https://www.symcon.de/en/service/documentation/command-reference/management-scripts/ ## IPS_CreateScript Source: https://www.symcon.de/en/service/documentation/command-reference/management-scripts/ips-createscript/ `int IPS_CreateScript(int $SkriptType)` creates a script **Parameters** - `$SkriptType` (int) | Value | Description | | ----- | --------------------------- | | 0 | generates a __PHP script__ | | 1 | generates a __Flow Script__ | | 2 | generates a __IPSWorkflow__ | **Returns** (int): ID of the newly created script | Value | Description | | ----- | --------------------------- | | 0 | generates a __PHP script__ | | 1 | generates a __Flow Script__ | | 2 | generates a __IPSWorkflow__ | **Example** ```php $ScriptID = IPS_CreateScript(0); echo"The Script ID is: ". $ScriptID; ``` ## IPS_DeleteScript Source: https://www.symcon.de/en/service/documentation/command-reference/management-scripts/ips-deletescript/ `bool IPS_DeleteScript(int $ScriptID, bool $DeleteFile)` deletes a script **Parameters** - `$ScriptID` (int): ID of the script - `$DeleteFile` (bool): __TRUE__ if the file should be deleted. __FALSE__ if the file should be moved to the 'deleted' folder. **Returns** (bool): If the command succeeds, it returns __TRUE__, otherwise __FALSE__. __TRUE__ if the file should be deleted. __FALSE__ if the file should be moved to the 'deleted' folder. **Example** ```php IPS_DeleteScript($ScriptID, true); // Delete script including file ``` ## IPS_GetScript Source: https://www.symcon.de/en/service/documentation/command-reference/management-scripts/ips-getscript/ `array IPS_GetScript(int $ScriptID)` return extensive information about a script **Parameters** - `$ScriptID` (int): ID of the script **Returns** (array): The following information is available as key => value pairs: | Index | Type | Description | | ------------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------ | | __IsBroken__ (until 3.4) | boolean | TRUE if an error occured during the last execution of the script, otherwise FALSE (since 4.0 replaced by ScriptIsBroken) | | __LastExecute__ (until 3.4) | float | Unix timestamp of the last call (since 4.0 replaced by ScriptExecuted) | | __ScriptIsBroken__ (since 4.0) | boolean | TRUE if an error occured during the last execution of the script, otherwise FALSE | | __ScriptExecuted__ (since 4.0) | integer | Unix timestamp of the last call | | __ScriptFile__ | string | Filename of the script | | __ScriptID__ | integer | ID of the script | | __ScriptType__ | integer | Type of the script (0: PHP script, 1: Flow script, 2: IPSWorkflow) | ID of the script **Example** ```php // Since version 4.0 print_r(IPS_GetScript(46413)); /* Examplary output: Array ( [ScriptIsBroken] => [ScriptExecuted] => 1204933792 [ScriptFile] => 46413.ips.php [ScriptID] => 46413 [ScriptType] => 0 ) */ print_r(IPS_GetScriptCompatibility(46413)); /* Examplary output: Array ( [IsBroken] => [LastExecute] => 1204933792 [ScriptFile] => 46413.ips.php [ScriptID] => 46413 [ScriptType] => 0 ) */ // Until version 3.4 print_r(IPS_GetScript(46413)); /* Examplary output: Array ( [IsBroken] => [LastExecute] => 1204933792 [ScriptFile] => 46413.ips.php [ScriptID] => 46413 [ScriptType] => 0 ) */ ``` ## IPS_GetScriptContent Source: https://www.symcon.de/en/service/documentation/command-reference/management-scripts/ips-getscriptcontent/ `string IPS_GetScriptContent(int $ScriptID)` _Requires Symcon >= 3.1_ returns the content of a script **Parameters** - `$ScriptID` (int): ID of the script **Returns** (string): The content of the script ID of the script **Example** ```php $Content = IPS_GetScriptContent($ScriptID); ``` ## IPS_GetScriptEventList Source: https://www.symcon.de/en/service/documentation/command-reference/management-scripts/ips-getscripteventlist/ `array IPS_GetScriptEventList(int $ScriptID)` returns all events that are assigned to a script **Parameters** - `$ScriptID` (int): ID of the script **Returns** (array): A list of IDs of events that are assigned to the script ID of the script **Example** ```php $events = IPS_GetScriptEventList($_IPS['SELF']); print_r($events); // determines all events of the current script ``` ## IPS_GetScriptFile Source: https://www.symcon.de/en/service/documentation/command-reference/management-scripts/ips-getscriptfile/ `string IPS_GetScriptFile(int $ScriptID)` returns the file name of a script **Parameters** - `$ScriptID` (int): ID of the script **Returns** (string): File name of the script ID of the script **Example** ```php include(IPS_GetScriptFile($ScriptID)); ``` ## IPS_GetScriptIDByFile Source: https://www.symcon.de/en/service/documentation/command-reference/management-scripts/ips-getscriptidbyfile/ `int IPS_GetScriptIDByFile(string $FilePath)` returns the ID of a script by its file **Parameters** - `$FilePath` (string): Relative path to the file from the script folder **Returns** (int): ID of the found script, otherwise FALSE Relative path to the file from the script folder **Example** ```php $ScriptID = @IPS_GetScriptIDByFile("12345.ips.php"); if ($ScriptID === false) echo "Script file not found!"; else echo "The ID of the script is: ". $ScriptID; ``` ## IPS_GetScriptIDByName Source: https://www.symcon.de/en/service/documentation/command-reference/management-scripts/ips-getscriptidbyname/ `int IPS_GetScriptIDByName(string $ScriptName, int $ParentID)` returns the ID of a script by its name **Parameters** - `$ScriptName` (string): Name of the script - `$ParentID` (int): Object whose child objects are searched for the script **Returns** (int): ID of the found script, otherwise FALSE Object whose child objects are searched for the script **Example** ```php $ScriptID = @IPS_GetScriptIDByName("Rain sensing", $ParentID); if ($ScriptID === false) echo "Script not foung!"; else echo "The Script ID is: ". $ScriptID; ``` ## IPS_GetScriptList Source: https://www.symcon.de/en/service/documentation/command-reference/management-scripts/ips-getscriptlist/ `array IPS_GetScriptList()` returns a list of all scripts **Returns** (array): A list ​​of all IDs of scripts This function determines the IDs of all scripts that are registered within IP-Symcon. The IDs are listed in an array. If no scripts exist, the array is empty. **Example** ```php $allScripts = IPS_GetScriptList(); print_r($allScripts); /* returns, e.g.: Array ( [0] => 37659 [1] => 18326 etc. ... */ ``` ## IPS_GetScriptTimer Source: https://www.symcon.de/en/service/documentation/command-reference/management-scripts/ips-getscripttimer/ `int IPS_GetScriptTimer(int $ScriptID)` returns the start value of the script timer **Parameters** - `$ScriptID` (int): ID of the script **Returns** (int): Time in seconds that the script is called cyclicly (not the remaining duration) ID of the script **Example** ```php $TimerValue = IPS_GetScriptTimer($ScriptID); // determines the value of the script timer ``` ## IPS_ScriptExists Source: https://www.symcon.de/en/service/documentation/command-reference/management-scripts/ips-scriptexists/ `bool IPS_ScriptExists(int $ScriptID)` checks if a script exists **Parameters** - `$ScriptID` (int): ID of the script **Returns** (bool): If the command succeeds, it returns __TRUE__, otherwise __FALSE__. ID of the script **Example** ```php if (IPS_ScriptExists(34881)) echo "A script with this ID exists!"; ``` ## IPS_SetScriptContent Source: https://www.symcon.de/en/service/documentation/command-reference/management-scripts/ips-setscriptcontent/ `bool IPS_SetScriptContent(int $ScriptID, string $Content)` _Requires Symcon >= 3.1_ set the content of a script **Parameters** - `$ScriptID` (int): ID of the script - `$Content` (string): Content, including PHP tags () **Returns** (bool): If the command succeeds, it returns __TRUE__, otherwise __FALSE__. Content, including PHP tags () **Example** ```php $ScriptID = IPS_CreateScript(0); IPS_SetName($ScriptID, "My Script"); IPS_SetScriptContent($ScriptID, ""); ``` ## IPS_SetScriptFile Source: https://www.symcon.de/en/service/documentation/command-reference/management-scripts/ips-setscriptfile/ `bool IPS_SetScriptFile(int $ScriptID, string $FileName)` sets the file name for a script **Parameters** - `$ScriptID` (int): ID of the script - `$FileName` (string): File name of the PHP file (relative to the "/scripts" folder) **Returns** (bool): If the command succeeds, it returns __TRUE__, otherwise __FALSE__. File name of the PHP file (relative to the "/scripts" folder) **Example** ```php $ScriptPath = "Example.ips.php"; //script file $ScriptID = IPS_CreateScript(0); // Bind IPS_SetScriptFile($ScriptID, $ScriptPath); ``` ## IPS_SetScriptTimer Source: https://www.symcon.de/en/service/documentation/command-reference/management-scripts/ips-setscripttimer/ `bool IPS_SetScriptTimer(int $ScriptID, int $TimerValue)` set the start value of a script timer **Parameters** - `$ScriptID` (int): ID of the script - `$TimerValue` (int): Time in seconds in which the script is called cylically **Returns** (bool): If the command succeeds, it returns __TRUE__, otherwise __FALSE__. Time in seconds in which the script is called cylically **Example** ```php // The script is run every 10 seconds IPS_SetScriptTimer($ScriptID, 10); ```