### Developing Scripts in Switch Source: https://cdn-www.enfocus.com/manuals/DeveloperGuide/SW/25.07/home Guides on developing scripts for Enfocus Switch, covering script declaration, creation, debugging, and deployment. ```APIDOC ## Developing Scripts This section covers the process of developing scripts for Enfocus Switch, from declaration to deployment. ### Script declaration Defines how to declare a script, including its main properties and execution mode. #### Main script properties Properties that define the core characteristics of a script. #### Execution mode Details the different execution modes available for scripts. - **Execution modes**: An overview of available modes. - **Execution group**: How scripts are grouped for execution. - **Selecting the appropriate execution mode**: Guidance on choosing the right mode. - **Switch executor cleanup**: Information on cleaning up Switch executors. #### Defining custom properties How to define and use custom properties within a script. #### Property editors Information on property editors used for configuring script properties. - **Extra properties for certain property editors**: Additional properties available for specific editors. #### Validating property values Methods and techniques for validating property values in scripts. #### External property editor How to use external property editors. #### OAuth 2.0 authorization editor Details on using the OAuth 2.0 authorization editor for scripts. ### Creating and using a script in Switch Step-by-step instructions on creating and integrating scripts into Switch workflows. #### Creating a script Guides on the process of creating a new script. #### Using a script in a flow How to incorporate a developed script into a Switch flow. ### Developing script code Guidance on writing and debugging the actual script code. #### Configuring Visual Studio Code Instructions for setting up Visual Studio Code for Switch script development. #### Debugging script code Techniques and tools for debugging script code. ### Deploying a script Information on how to deploy scripts within the Switch environment. #### Protecting a script Methods for protecting scripts from unauthorized access or modification. ### Recommended ways to work with scripts Best practices and recommended workflows for script development. #### Developing a brand-new script Detailed steps for creating a script from scratch. - **Creating a new script folder** - **Editing the .sscript file using SwitchScripter** - **Editing the main.ts file using Visual Studio Code** - **Testing and debugging the script in a flow** - **Deploying the script** - **Debugging the deployed script** #### Starting from a script package Guidance on using script packages as a starting point. - **Debugging** - **Packages** - **Support for TypeScript** #### Starting from a legacy script Instructions for migrating or adapting legacy scripts. #### Updating older Node.js apps to work with Switch 2024 Guidance on updating existing Node.js applications for compatibility with newer Switch versions. ### Automating third-party applications How to use Switch scripts to automate external applications. #### Third-party application settings Configuration settings for integrating with third-party applications. #### Property sets Using property sets for third-party application automation. #### Communication requirements Requirements for communication between Switch and third-party applications. #### Communication mechanisms Various mechanisms used for inter-application communication. #### Text encoding issues Addressing potential text encoding problems during integration. ``` -------------------------------- ### SwitchScripter - Launching and Workspace Source: https://cdn-www.enfocus.com/manuals/DeveloperGuide/SW/25.07/home Instructions on launching SwitchScripter and navigating its workspace interface. ```APIDOC ## SwitchScripter ### Launching SwitchScripter Steps to start the SwitchScripter application. ### Workspace window Description of the main workspace window in SwitchScripter. ### Toolbar Explanation of the tools and buttons available in the SwitchScripter toolbar. ### Declaration pane Details about the pane where script declarations are managed. ### Properties pane Information on the pane used to view and edit script properties. ### Message pane Description of the pane that displays messages, errors, and logs from SwitchScripter. ``` -------------------------------- ### Switch Scripting API Reference Source: https://cdn-www.enfocus.com/manuals/DeveloperGuide/SW/25.07/home Reference documentation for the Switch scripting API, detailing classes, methods, and enumerations available for Node.js scripting. ```APIDOC ## About the Switch Scripting API This section details the Node.js based Switch scripting API, outlining its components and differences from the legacy API. ### About the Switch scripting API Provides an overview of the scripting API available for Node.js in Enfocus Switch. ### Differences between the legacy and the Node.js based API Explains the key distinctions between the older scripting API and the current Node.js based API, covering entry points, property values, job file access, sending jobs, and a mapping table. #### Entry points Describes the various entry points for scripts and script expressions. - **Script entry points**: How scripts are initiated. - **Script expressions entry point**: How script expressions are handled. #### Property values Details how property values are managed within the scripting environment. #### Job file and dataset file access Explains how to access and manipulate job files and dataset files programmatically. #### Sending jobs Provides information on how to send jobs through the scripting interface. #### Scripting API - Mapping table A reference table mapping legacy API functions to their Node.js equivalents. ## Switch Class Represents the main Switch application context and provides methods for managing global data, webhooks, and script execution. ### Methods - **Switch Server version**: Retrieves the version of the Switch Server. - **Managing global data**: Methods for accessing and modifying global data within Switch. - **Webhooks**: Functionality related to handling webhooks. - **Aborting scripts**: How to programmatically abort script execution. - **Translation support**: Methods for managing translation features. - **Getting global user preferences**: Accessing user-specific global preferences. ## FlowElement Class Represents a flow element within a Switch configuration. ### Methods Details the available methods for interacting with FlowElement objects. ## Job Class Represents a print job within Switch, providing extensive methods for accessing and manipulating job properties and content. ### Methods - **Getting job information**: Retrieves metadata and properties of a job. - **Accessing job content**: Methods for accessing the files and data associated with a job. - **Logging messages**: Functionality for logging messages during script execution. - **Manipulating private data**: How to work with private data associated with a job. - **Private data used by built-in elements**: Information on private data used by Switch's built-in elements. - **Manipulating datasets**: Methods for creating, reading, and writing datasets. - **Creating a new child job**: Functionality to create a new child job from an existing one. - **Routing a job**: How to control the routing of a job within the workflow. - **Job priority**: Methods for setting and managing job priority. ## Connection Class Represents a connection within Switch. ### Methods Details the available methods for interacting with Connection objects. ## ImageDocument Class Represents an image document, providing methods for image manipulation and analysis. ### Static methods Methods that can be called directly on the ImageDocument class. ### Instance methods Methods that operate on specific ImageDocument objects. ## PdfDocument Class Represents a PDF document, offering methods for PDF manipulation and analysis. ### Static methods Methods that can be called directly on the PdfDocument class. ### Instance methods Methods that operate on specific PdfDocument objects. ## PdfPage Class Represents a single page within a PDF document. ### Methods Details the available methods for interacting with PdfPage objects. ## HttpRequest Class Facilitates making HTTP requests from within scripts. ### Methods Methods for configuring and executing HTTP requests. ### Properties Properties available for configuring HTTP requests. ## HttpResponse Class Represents the response received from an HTTP request. ### Methods Methods for accessing and processing the HTTP response. ## XmlDocument Class Represents an XML document, providing methods for XML parsing and manipulation. ### Methods Details the available methods for interacting with XmlDocument objects. ## XmpDocument Class Represents an XMP (Extensible Metadata Platform) document, allowing for metadata manipulation. ### Query language Describes the query language used for XMP data. ### Methods Methods for accessing and modifying XMP metadata. ### Standard XMP namespaces Lists the standard XMP namespaces used within Switch. ## Enumerations Provides definitions for various enumerations used throughout the Switch scripting API. - **AccessLevel** - **Connection.Level** - **DatasetModel** - **LogLevel** - **PropertyType** - **Scope** - **EnfocusSwitchPrivateDataTag** - **ImageDocument.ColorMode** - **ImageDocument.ColorSpace** - **HttpRequest.Method** - **Priority** ``` -------------------------------- ### SwitchScripter Tool Source: https://cdn-www.enfocus.com/manuals/DeveloperGuide/SW/25.07/home Documentation for the SwitchScripter tool, used for managing and developing Switch scripts. ```APIDOC ## SwitchScripter Information about the SwitchScripter tool, a utility for managing Switch scripts. ### Create mode Details on using SwitchScripter in create mode to generate new script files. ### Pack mode Information on using SwitchScripter in pack mode to package scripts. ### Unpack mode Instructions for using SwitchScripter in unpack mode to extract script contents. ### Transpile mode Details on using SwitchScripter in transpile mode, likely for code conversion (e.g., TS to JS). ### GenerateTranslations mode Information on generating translation files using SwitchScripter. ### List mode How to use SwitchScripter in list mode to view script package contents or other script-related information. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.