Adding Attachments

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 Desktop clients, the addition of the sound file as an attachment ensures that it will always be present and accessible on any system.

Attachments are added and managed by way of the Task Builder's Attachments Debug Panel. It displays any files that are currently attached to the task along with their original file name and extension.

To attach a file to a task

  1. Do one of the following to open the Attachment Explorer window:

    • Right-click anywhere inside the Attachments debug window and select Add on the context menu.

    • Click Add Attachment on the Insert command group of the ribbon.

    • In the Attachment Explorer window, navigate to, and select the file you want to attach, then click Open. This attaches the file to the task and the attachment properties (described below) are displayed in the Attachments debug window.

  2. In the Attachments debug window, view or enter the following information:

    • Name - The name of the attachment (required). The name you enter will be used as a placeholder for the file during runtime, therefore, the following rules apply when specifying attachment names:

      • Names must contain only alphanumeric characters.

      • Must begin with a letter.

      • Cannot contain any spaces.

    • Attachment - The file name of the attachment file. Use the folder icon to browse to the file you wish to attach.

    • Description - A user defined description of the attachment (optional).

    • Attached - The date and time the file was initially attached to the task (this value is read-only).

  3. 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.

Accessing 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.

AMAttachment.Name is essentially an Automate Desktop 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 10, this directory is C:\Users\[username]\AppData\Local\Temp\attachmentFile.txt.