![]() |
|||||||||||||
The “Configuration Utility Script Library” ![]() The Apple Configurator Automator actions are based upon the Configuration Utility Script Library, a collection of handlers, written in AppleScriptObj-C, that serve as an Apple Event interface to the Apple Configurator’s built-in command-line tool: cfgutil While the handlers contained in this library are used by the Apple Configurator Automator actions, they may also be called by external AppleScript and JavaScript (JXA) scripts, as well as from within the Run AppleScript or Run JavaScript Automator actions. And in fact, the script library provides the handlers used by the Apple Configurator Automator actions to perform their tasks. ![]() Viewing the Apple Configurator Script Library Detailed documentation containing explanations and examples for using the script library handlers are provided here, or can be viewed in your default web browser by running this script in the Script Editor application:
Calling Library Handlers in a Script Here are two versions of the same script (written in JavaScript and AppleScript) that use the script library to rename a connected device to a base name appended with its serial number. NOTE: Most handlers contained by the Configuration Utility library begin with the letters “CNFG”, such as CNFGvaluesOfSpecifiedProperties(…) and CNFGrenameSpecifiedDevice(…) but in the JavaScript for Automation (JXA) language, class names begin with a capital letter, so make the first letter in the handler name a lowercase letter, as shown in the example below, to avoid having JavaScript confuse the handler name with a class: Adding Scripts to Workflows By default, Automator includes actions for adding custom script code to workflows: Run AppleScript, Run JavaScript, and Run Shell script. Adding the Run AppleScript or Run JavaScript actions to your configuration workflow allows you to process the passed devices with your own customized script routines that can optionally include calls to the Configuration Utility script library (⬇ see below ) ![]() |