Copying and Reusing Task Steps
Overview
In computer programming, the reuse of code is a common technique used to save time, reduce redundancy and eliminate errors by applying the same segment of code in multiple applications. The Task Builder plays a similar role by allowing task steps to be copied and re-used within the same task or across multiple tasks. This article describes various methods to perform this operation.
Copying task steps
The Step tab of the ribbon contains clipboard commands that allow you to reuse steps within a task by copying one or more steps and pasting them onto another section of the task. Because more than one instance of Task Builder can be opened simultaneously, code reuse can be performed across multiple tasks as well. The Copy command, in effect, copies the .AML code associated to each task step. This code can be pasted onto a specific step on the same task or another task using the Paste command. Alternatively, a Copy > Description command is available, allowing the textual description of each step to be copied and pasted onto another application outside of Task Builder, such as an email message or text file.
To copy and paste steps in the same task
- Select the task you want to work with to open Task Builder.
- From the Steps panel, select the steps to copy. To select a group of steps, hold down CTRL during selection. Use CTRL+A to select all.
- On the ribbon, select the Step tab, and then select Copy. You can also right-click the highlighted steps, and then select Copy.
- In the Steps panel, select the step of where you want to place the previously copied steps.
- On the ribbon, select the Step tab, and then select Paste. The copied steps are pasted precisely at the step you selected. Existing steps are moved directly below the pasted steps.
To copy steps from one task to another existing task
- Select the task you want to copy steps from in order to open the first instance of Task Builder.
- Select the task you want steps to be pasted onto in order to open the second instance of Task Builder.
- In the Steps panel in the first instance of Task Builder, select the steps to copy . To select a group of steps, hold down CTRL during selection. Use CTRL+A to select all.
- On the ribbon, select the Step tab, and then select Copy.
- In the Steps panel of the second instance of Task Builder (where you want to paste your steps), on the ribbon, select the Step tab, and then select Paste. The copied steps are pasted precisely at the step you selected. Existing steps are moved directly below the pasted steps.
To copy steps from one task to a new task
- Create and edit a new task to open the first instance of Task Builder.
- Select the existing task you want to copy steps from the second instance of Task Builder.
- In the Steps panel of the second instance, select the steps to copy . To select a group of steps, hold down CTRL during selection. Use CTRL+A to select all.
- On the ribbon, select the Step tab, and then select Copy.
- Select the first instance of Task Builder which is associated with the new task.
- In the Steps panel of the first instance of Task Builder, on the ribbon, select the Step tab, and then select Paste. The copied steps are pasted directly onto the Steps panel of the new task.
To copy and paste step descriptions
- In the Steps panel, select the steps to copy the description from. To select more than one step, hold down CTRL during selection or use CTRL+A to select all steps.
- On the ribbon, under the Step tab, select Copy > Description. You can also right-click in the Steps panel, and then select Copy > Description.
- You can paste the text into any Automate Desktop box where plain text is accepted. You can also paste copied steps or step descriptions in other documents such as email messages or text files.
- When Copy > Description is selected, the content of the clipboard becomes populated with the “Visual View” text-only description that is normally displayed in the Steps panel and does not contain any AML code (even if the Steps panel is currently set to be viewed in AML format).
- To copy the AML code of a particular step instead of the text description, select Copy from the ribbon interface or right-click the step and select Copy from the shortcut menu (not Copy > Description). Doing so will allow you to paste the AML code into a document, text file or any field in Automate Desktop that accepts text.
- Selecting Copy will also allow you to paste the content as a step in the Steps panel.
Saving a copy of a task
Steps of an existing task can be re-used in a newly created task by selecting the Save Copy As command. This is an ideal method for copying all of the steps of an existing task onto a new task.
To save a copy of a task
- Open the task you wish to copy steps from by doing
one of the following:
- From Task Administrator, right-click the task, and then select Steps. The Task Builder appears for this task.
- If a new (unmanaged) task was initially created by directly opening the Task Builder from the Start menu, select Open from the Application menu and navigate to the task (.AML) file you wish to open and click the Open button. In this case, a separate tab appears in the Steps pane of the Task Builder, each signifying an open task.
- From Task Builder's ribbon interface, select File > Save copy as.
- Navigate to the desired location, enter a name for the new task, and click Save.
Using snippets
Another way of using a group of steps within a specific task is to save the steps as Snippets. Snippets provide an easy way to implement frequently used code into a task. They are particularly useful to those who use specific activities that contain commonly used properties or settings. Instead of re-entering the properties for a specific activity or series of activities every time they're added as task steps, users can save existing steps as a snippet and simply drag and drop the snippet wherever it is needed in any task.