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:
    1. Right-click anywhere inside the Attachments debug window and select Addfrom the context menu.
    2. Click Add Attachment from the Insert command group of the ribbon.
  2. Click Add Attachment from the Insert command group of the ribbon.

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

  4. From the Attachments debug window, view or enter the following information:

    1. 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:
      1. Names must contain only alphanumeric characters.
      2. Must begin with a letter.
      3. Cannot contain any spaces.
    2. Attachment - The file name of the attachment file. Use the folder icon to browse to the file you wish to attach.
    3. Description - A user defined description of the attachment (optional).
    4. Attached - The date and time the file was initially attached to the task (this value is read-only).
  5. 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.