Store data in Automator workflows

There's a good article over at Otto's Garage that examines just how Automator passes information from one step to another within a workflow. As author J. Kevin Wolfe notes, sometimes you want to store data at the first step of a workflow, only to use it again several steps later. Unfortunately, there's no built-in way to have Automator ignore that initial piece of information while dealing with other data in subsequent steps, and then retrieve and use the information from step one. But he's devised a way to keep this information on the back burner by using the clipboard and a simple Applescript. He writes:

"There's a simple way you can do this in Automator. To store references, use the Copy to Clipboard action from System Library. Place this after the results you need to store. Then to call it up, place a Run AppleScript action in the workflow with the following scriptlet before the action that needs the data from earlier in the workflow:

–Return Clipboard Contents to Data Flow
return (the clipboard)

This takes the information stored on the clipboard and puts it back in the Data Flow."

Pretty nice.  Thanks, J. Kevin!

 

Recommended