Dise provides the option to run a script to set status for connected screens instead of relying on an RS-232 or network protocol. It is applicable to screens that does not have a standard protocol but instead write status to a file, for example.
TABLE OF CONTENTS
Get the powerstate as decided by power override or schedule.
Returns a string that is either "on" or "off"
string Screen.GetVariable(string name)
Get string from an variable, all variables from the portal should be available. But variables in the playback are not available.
Screen.SetVariable(string name, string value)
Set string to an variable. This variable can only be read from the same screen. It is not possible to read this variable from another screen script running or from the playback.
#pragma language JScript // If temperature is above this value, set error status var TMP_THRESHOLD = 75; // Temperature is written to a text file, open file and read it var fso = new ActiveXObject("Scripting.FileSystemObject"); var f = fso.OpenTextFile("C:\\screen\\temperature.txt", 1, true); state = JSON.parse(f.ReadAll()); f.Close(); var temperature = f.ReadAll(); // Set temperature value and error status Screen.AddStatus("Temperature", temperature); Screen.AddStatus("TemperatureError", (parseInt(temperature, 10) > TMP_THRESHOLD).toString());
Setting the screen script
- Encode the script text as Base64. Use for example this page: https://www.base64encode.org/
- Go into a player's custom settings (see this article: Custom settings )
- Add the Screen.script setting.
- As value, paste the base64 encoded text from step 1.
- Click Save
- Publish the player.