Error: Invalid Data. Review all error messages below to correct your data.
Starting from Switch 2017 scripts written using the AppleScript scripting language are deprecated. It is still possible to use already existing scripts in Switch flows (on Mac), however it is no longer possible to create and debug such scripts in SwitchScripter.
A Switch script in any scripting language normally uses the following types of API:
Platform API: access to file system, network communication, processes management etc.
Switch scripting API: environment exposed by Switch that includes objects like Switch, Job, Connection, Dataset etc.
Third-party applications scripting API: automation interfaces offered by other applications, for example, command line interface, scripting API (that can be platform-dependent: VBScript on Windows, AppleScript on Mac), COM interfaces on Windows, SOAP or REST API etc.
The calls to the API types listed above are included in the general script logic that normally also involves other typical tasks like string manipulation, storing and sorting data in memory using containers, converting between types of data, searching in strings, serializing and parsing data etc. These tasks are performed using some “standard” set of features provided by the language: basic data types, library of objects (including containers) and algorithm implementations.
The more difficult case is when the AppleScript includes calls to the scripting API of a third-party application (for example, a script that uses AppleScript API exposed by Adobe InDesign).
Minimize the amount of the logic that needs to remain in AppleScript as much as possible and make sure this logic does not use the Switch scripting API.
Here is an example of a Switch script in pseudo-AppleScript containing commands for the Adobe InDesign application:
tell application "Adobe InDesign CC 2017" -- open a document in Adobe InDesign using job path -- process the document (for example, update external links) -- export the resulting document in a temporary PDF file -- close the document end tell
Assuming the only available automation interface for InDesign is AppleScript, the following steps should be performed:
It is also necessary to foresee the error handling (for the cases when ‘osascript’ fails or hangs).
The described approach can be considered as automating an application using a command line interface (‘osascript’ utility) with a command file parameter that is a small script in AppleScript.
Specifically for AppleScripts driving the Adobe InDesign application there are other possible approaches:
The ‘osascript’ utility that will execute small fixed managing AppleScript
The Adobe ExtendScript Toolkit application
The fixed managing AppleScript is a script like: