About Attachments

Attachments allow a file of any type to be embedded within a task so that third-party elements can be included with a task for greater portability. This can make exporting and sharing tasks a whole lot easier. For example if you have a task that plays a .wav file when a certain event occurs, you can guarantee the sound file will always be present on the system by attaching the file to the task.

Once the task is added and saved, the Task Builder will attach each file in the Attachments window to the AutoMate task file. At runtime, these attachments are extracted and placed in the user's temporary files location.

Adding Attachments

An attachment can be added from the Task Builder by selecting the File menu and navigating to Attachments -> Add... Upon adding an attachment, a dialog titled Attachments (displayed below) opens. For more details on how to add or remove an attachment from the Attachments Debug window, refer to Attachments Debug View.

Attachment Dialog Parameters

Name

The name of the attachment. This name is used to call upon the attachment during task execution.

Attachment File

Specifies the path and filename of the attachment.

Description (optional)

Specifies an optional description that can be entered about the attachment.

Accessing Attachments

Once an attachment is added to a task, it can be accessed in any task step by using %AMAttachment.Name% where Name is the name chosen for the attachment as specified in the Attachment dialog. AMAttachment.Name is basically used as a placeholder for the attachment file during runtime.

For example, if MyAlarm was the name chosen for the sound file C:\MySounds\ScreamingBoar.wav (as shown in the sample dialog displayed above) this file can be referred to in a 'Play Audio' step during runtime by entering %AMAttachment.MyAlarm% in the Audio file(s) to play parameter (as shown below).

NOTE: Attachments can be of any type and size, but be aware that the size of the task file expands with the size and number of attachments. Large or multiple attachments used in a single task may slow down task execution.

See Also

Attachments Debug View