NERD! Homepage

Archive for the ‘mac’ Category

Abort an Automator workflow

I wanted to abort an OSX Automator workflow if there’s no internet connection. That function does not exist. It can be done by inserting the action Run Applescript though:

try
do shell script "curl www.apple.com"
on error
do shell script "killall name-of-this-script"
end try

Fill in the name of your Automator application and if there’s an error the script will terminate itself. This way you can build multiple checks. For instance I have another check that stops the automator workflow if a certain disk is not mounted. And suddenly Automator becomes a handy tool.

Delicious (Dutch)