Reusing Automator Variable Later in Project

I’ve got an Automator app/workflow that allows me to choose a file, assign a variable to it and run a script against it.

However, I need to run a similar process against the same file later in the script, but when I use “Get Value of Variable” and step through the workflow, the scripts immediately afterward fails. No explanation why.

To be more precise:

  1. Ask Finder for Items

  2. Set Value for Variable

  3. Run Shell Script

This all works fine up to this point

Later in the script I run:

  1. Get Value for Variable (it’s the only one in the workflow, so I’m not choosing the wrong one)

  2. Run Shell Script

And it fails at this point saying, “The action ‘Run Shell Script’ encountered an error. Check the actions properties and try running the workflow again”.

I have tried no end of things to fix this, but with no success. I’ve finally just dropped back to adding another “Ask For Finder Items”, but it’s tedious having to navigate the file tree back to this file again.

I found this and tried it:

http://hints.macworld.com/article.php?story=20080213200213250

But none of my variables is wrapped in $(). I tried every UUID I could find, but still, the same error message.

Thanks