Attachments

Overview

Attachments allow files of any type to be embedded within a task so that third-party elements can be incorporated for greater portability. At runtime, attachments are automatically "unwrapped" to the local temp directory where they can be accessed by the task. For example, you can create a task that plays a unique sound when a particular event occurs by attaching the associated sound (.wav or .mp3) file to it. When deploying or exporting this task to other AutoMate clients, the addition of the sound file as an attachment ensures that it will always be present and accessible on any system.

Related Topics

Adding Attachments

Attachments are added and managed via the Task Builder's Attachments Debug Panel. It displays any files that are currently attached to the task along with their original filename and extension.

To attach a file to a task:

  1. Right-click anywhere inside the Attachments debug panel and select Add from the context menu that appears. This opens a dialog titled Attachment (shown below).
  2. Enter the following information:
  1. Upon completion, click OK. The new attachment and its properties are displayed in the Attachments Debug panel.

NOTE: Multiple files of any type and size can be attached to a task, however, be aware that the size of the task file expands with the size and number of attachments, which may affect performance. Multiple or large sized attachments used in a single task may slow down task execution.

Using Attachments

Once an attachment is added to a task, it can be accessed in any step by entering:

%AMAttachment.Name%

where [Name] is the name of the attachment specified in the Name parameter of the Attachment dialog. For example, assume you created an attachment identical to the one displayed above. In order to play the attachment file c:\temp\mySounds\AutoAlert.wav using a Play Audio activity during runtime, simply enter %AMAttachment.Auto_Alert% in the Audio file(s) to play parameter of this activity.

AMAttachment.Name is essentially an AutoMate dataset used as a placeholder for the attachment file during runtime. The file itself is unwrapped and saved to the local temp directory. This directory may vary depending on the operating system. On Windows Vista, Windows 7 and Windows Server 8 operating systems, this directory is:

C:\Users\[username]\AppData\Local\Temp\attachmentFile.txt