Used to run a script from the server and return the output form the script back to the caller.. Any errors are returned as json data. Data coming back are checked for [ or { in start and then deemed json or html.

To call use /run/script/scriptname

The script name is the name it is defined as in WebServer table or a filename relative to root of system. The type should be Script, name should be unique and security can be set to any level you want the be able to run this script.

How to define a script definition

A script are composed of a cmd that call the exe file to run and 0 - 9 args and a payload that goes to stdin if wanted. All parts of the script definition understands LiveText, so you can use these to read information from the server.

Payload specific LiveText 

.session.payload for raw payload send with put or post. The livetext .session.payload.keyname for any _indata with name. Only work for one level payloads at the moment, but will be extended. Indata will be auto parsed of firs use and will only do the parsing the first time. The settings for type and charset can be read by .session.payload.payloadtype and .session.payload.payloadcharset.
run: /run/script now can take payload to send to stdin on call.

How to call a python script that read from stdin for a what to do
.cmd C:\ProgramData\ds2imply\dedsscripts3\Scripts\python.exe
.arg1 C:\ProgramData\ds2imply\dedsscripts3\main.py
.payload
{
  "action": "versions"
}

This one have the payload embedded and can be called by get


A script that takes whatever you send in a post or put and send that to stdin
.cmd C:\ProgramData\ds2imply\dedsscripts3\Scripts\python.exe
.arg1 C:\ProgramData\ds2imply\dedsscripts3\main.py
.payload [{session.payload}]

This one read it form the raw buffer send, so it you send a json string that is what is forwarded to the script


A normal script that only takes args
.cmd C:\ProgramData\ds2imply\dedsscripts3\Scripts\python.exe
.arg1 C:\ProgramData\ds2imply\dedsscripts3\main.py
.arg2 versions
.arg3 C:\ProgramData\ds2imply\localappsettings\hxvdcdijrgzn5d2y.json
.arg4 C:\ProgramData\ds2imply\dedsscripts3\input.json

this will send just normal args to the script runner and the rules is not "" around each arg as the spawn process will do it for you. Also see that the args are numbered as reading commands are put in a json object and the keys need to be uniqe names in correct case.


The old format still allowed execept for ARG

The script is defined in the body of the document in ini file format KEY=VALUE one each line.


CMD
The executable to be called. You can use LiveText in the value to manipulate the command.
ARG
One arg to be added to arguments sent as a string. It will be read in the order set in body. It will then put together the args manually by seperating with space between. It will be looking for -, / or " to just add the value or if none, check for space in arg and add "aroundval". You can use LiveText to manipulate the arg.
ARGS
All arguments in the exact format it will be sent to the subprocess command. It supports LiveText to take any before script run data like [{session.query.name}] that will take the name in ?&name=value


CMD=C:\DEDSScripts\python.exe
ARGS="E:\Projects\DENext\DataEase4Web\DEDeploy\appdifffromconfig.py" "C:\ProgramData\ds2imply\localappsettings\[{session.query.name}].json"

Example that call a python script the will do a diff on a application. The name of the application is read from query parameter name=