How Smart Client scripts work
A Smart Client script is a configuration file (.scs) that automates repetitive workflows in XProtect Smart Client, such as logging in, selecting workspaces, navigating views, and responding to user interactions.
When XProtect Smart Client is installed, Windows automatically associates the .scs file extension with the application. You can launch scripts in multiple ways:
Double-clicking the file: Opening a
.scsfile directly in File Explorer launches XProtect Smart Client and runs the script.Windows startup automation: You can place a
.scsfile (or shortcut) in the Windows Startup folder to automatically launch and configure XProtect Smart Client when the computer boots; a common setup for dedicated wall monitors or Smart Wall workstations.Command line or shortcuts: You can launch the Smart Client from a command prompt, script, or custom desktop shortcut by passing the
-Scriptparameter:Client.exe -Script="C:\Path\To\Script.scs"
By default, XProtect Smart Client runs scripts in a sandboxed, validated environment. Before running any script code, the Smart Client scripts engine checks the entire file against an allow-list of safe commands, language features, and resource limits. If any part of the file contains unsupported syntax or attempts unauthorized system operations (such as file or network access), the engine refuses to run the entire script.
Note
If legacy runtime compilation is enabled in Client.exe.config, the client instead uses the deprecated legacy engine, compiling and running the script as arbitrary C# without validation checks.
Script lifecycle
When XProtect Smart Client loads a script, it runs in three stages:
Login: If the script file contains a
<Login>under the<ScriptEngine>root element, Smart Client attempts to log in automatically using the specified server and credentials. If this block is omitted, the standard login dialog displays for manual sign-in.Startup actions: Once login succeeds and the main workspace is fully loaded, the client executes the script body (
<Script>). This contains startup automation using available Smart Client actions, such as minimizing or maximizing the application, switching to a specific workspace or view, or jumping to a playback timestamp.Event triggers: If the script defines event triggers (
<OnEvent>), those triggers remain active in memory throughout the user's session. They run designated actions whenever matching events occur—such as when an operator selects a different view, switches view items, or changes workspaces.