Writing Scripts
Write scripts on the Process pages of executable objects. The integrated script editor features many capabilities to help you write your scripts.
Analyzing, Generating and Modifying Scripts Using the Intelligent Assistant
Automic Automation scripts can be large and complex. Understanding or writing them from scratch can be time-consuming. You can leverage Automic Automation's Gen AI capabilities using the Automation Assistant to analyze existing scripts, troubleshoot logic or generate entirely new code snippets using natural language prompts. For more information, see Generating and Analyzing Code Using AI.
Analyzing Existing Code
The Automation Assistant describes script logic in plain language, breaks down its content, and explains individual elements. It also identifies syntax errors or potential logic issues, suggesting specific improvements.
You can request responses in various formats (such as JSON or Markdown) and converse with the assistant in any language, regardless of your interface settings.
To Analyze Code with the Automation Assistant
-
In the script editor, do one of the following:
-
Select a specific block of code you want the assistant to explain.
-
Ensure nothing is selected if you want an explanation of the entire script.
-
-
Right-click and select Analyze Script or Analyze Script Element.
-
The Automation Assistant pane opens on the right. It provides a breakdown of the script's contents and, if applicable, indicates errors and suggests fixes.
-
For further clarification, type follow-up questions in the Ask field at the bottom of the pane.
-
To clear the history or exit the chat, click on the three dots next to the chat box and select the relevant option.
Generating Code with AI
Instead of manually coding every line, you can describe your requirements in plain language and let the Intelligent Assistant draft the script for you.
To Generate Code with the Intelligent Assistant
-
Open the script editor in the object you are configuring.
-
Right-click to select Ask Intelligent Assistant.
-
Describe what you want the script to do.
Examples:
Write a Python script to check the status of a network service and log the results.
Create a Bash script that clears all files older than 30 days from the /temp directory.
-
The Intelligent Assistant pane opens, and your prompt is processed. The assistant then generates and inserts the new code directly into the script editor.
-
Review the generated code. You can use the chat interface to refine the logic (for example, Add a check to see if the directory exists first) until the script meets your requirements.
Supported Languages
The Automation Assistant supports various scripting languages. You do not have to indicate the type of language that the assistant should use, though. It automatically identifies the language that the script should use based on the type of object and Agent used in the object. This list indicates the language automatically used by the assistant depending on the type of object and specific Process page:
On the Process pages (Pre Process, Process, Post Process) of Events, File Transfers, Jobs, Notifications, Schedules and Workflows
-
Windows Jobs: BAT and PowerShell
-
Unix Jobs: Shell
-
Python Jobs (both Windows and Unix): Python
Writing Scripts Using the Automation Engine scripting language
If you are familiar with other common scripting languages, you will find the Automation Engine scripting language easy to learn.
This section describes the basic principles of writing Automation Engine scripts:
Note: Scripting is an advanced topic. Working knowledge of configuring, executing and monitoring objects and workflows is a prerequisite.
Automation Engine Scripting Language Legal Notice
The Automation Engine Scripting Language is subject to specific terms, see Automic Automation Scripting Language - Legal Notice.
This section includes the following pages: