Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am editing an Automator workflow that currently takes several stored spreadsheets and emails them to different individuals. The spreadsheets are stored on a Windows server and are created by a separate process not germane to this discussion. But once they're created, I want the user to be able to click on this action and have the mail messages (usually 8 of them) pop up to be sent.

All this works fine, as long as the Mac's connection to the server exists. If the server connection isn't present, things fail silently, because the files aren't there.

I've looked through all the possible steps you can add in Utilities, Other, and Finder (and all the rest) and I can't find any way for it to do something like e.g. 'Skip this step if the variable ServerConnected is not null'.

I can automagically connect to the server with an Automator action, but if it's already connected, I get another connection, which causes me trouble later on...unmounting unmounts the first one and the server stops showing up, but then the path in /Volumes is still's a road I don't want to go down.

So, is there any way to use variables to check if a condition is true or false and skip steps based on that? Or any other way to accomplish the task? I don't use Automator too much, I'm more comfortable with scripting the old fashioned way so even cracking open the .workflow file and editing parameters by hand is an option, presuming you can do that. I'm editing this particular workflow because it was developed by someone else, and it really does do a good job in general, except for the server connection glitch.

share|improve this question
up vote 1 down vote accepted

You could split it into 3 automator apps and branch with a shell script. Run the normal workflow up to the connection check, and then use the automator action Do Shell Script.

That script could be something like:

#! /bin/bash

        <your command to test connection>
        open /pathto/
        open /pathto/
fi would contain the remainder of you automator workflow would contain the actions to take if the server connection fails

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.