Conditional run of automator action

Hi all -
I’ve been using an automator script tied to an iCal event to produce a daily digest of files that have a modified date of today located in a specific folder on my hard drive. This script reads the contents of the folder, returns back a posix list of any files that have today as the modified date, adds that posix list to a pre-scripted email that then sends to a group of people alerting them to the presence of these new files. They all have access to the files in that folder because that folder is actually a shared Dropbox folder amongst them. It’s simply an email alert to tell them there’s something new in there.

It works great - with the only exception being that the email is generated every day regardless of whether there’s actually new content in that folder or not. I’d like it to be conditionally run - i.e. - email gets generated only if there are actually new files to announce in the folder.

So my question is… does anyone know how to put a conditional if/then type of statement on an automator action that aborts the action if there’s no relevant input? Or maybe make the action skip specific steps if the return is empty. Perhaps I’m missing something really simple that’s right in front of me, but I just can’t see it.

Thanks in advance for any help -
CSD

answered my own question with a simple applescript added to the mix:


if input is {} then error number -128 -- 'user cancelled'

That stops the script for me if it finds nothing new in the queried location.