Reusing Automator variable later in process

bowjest

Registered
I've got an Automator process that I use to run a perl script with a couple of switches.

The only problem I'm having is that the file which I select at the beginning of the Automator service needs to be used again later in the same service, but so far it isn't being called the second time.

I've had to put in two instances of "Ask for Finder Items" (one at the start, before calling the perl script and then later when the same perl script is called again, but with a different switch).

Here is what I'm doing:

1. Ask for Finder Item

2. Set Value of Variable

3. Run Shell Script

4. Launch App (for spell checking after the perl script has done its magic)

5. Ask for Confirmation - to give me time to spell check the resulting text file from running the shell script in Step 2.

6. *** At this point, I tried to put in "Get Value of Variable", and although when I step through the program it displays the correct path and file...

7. *** Run Shell Script - at this point the process fails - no explanation why, it just says that there has been an error.

To get around this, after Step 5 "Ask for Confirmation" I've had to put in another instance of Step 1 "Ask for Finder Item".

It works, but it's tedious to have to navigate back through the file structure to get to the same file again. If the variable is recognised and processed the first time (and is displayed correctly in the Results pane the second time at Step 6 when I step through the service), why isn't it passed correctly to the perl script in Step 7?

Any advice would be greatly appreciated.

Bowjest
 
Is the quick answer just that Automator doesn't allow you to use the same variable twice if it is file that is being acted upon?
 
So there's no way to use a named variable more than once in Automator? Really? I would have thought Apple would have thought this through better if that's the case.
 
Back
Top