When using an automator workflow with the following actions:

  • Get Specified Finder Items (some zip files)
  • Open Finder Items (with an unzipping utility)
  • Move Finder Items (to an existing folder)
  • Filter Finder Items (i.e. excluding folders)

I get mixed results, most of the time the filtered Items are incomplete. Some of the latest unzipped files are missing from the "Filter Finder Items" results.

I learned here that this specific action uses spotlight to provide the results. So this makes sense, as the newest files created might still not be indexed a few seconds later.

So the question is, how can I make sure that the parent folder or the files are properly indexed before using the "Filter Finder Items" action?

I've tried using the "Pause" action, but depending on the hardware or system load, we are quickly in the tens of seconds to have an uncomfortably uncertain reliability of this workaround.

How could we solve this? Any help appreciated

1 Answer 1


You add a shell script as the first automator task to run sudo mdutil -E /. This will rebuild the index.

  • Thanks for your answer, but doesn't it sounds like throwing the baby out with the bathwater? Plus, the index rebuilding may take a lot of time, and we still don't know when it's finished.
    – Arko
    Mar 10, 2015 at 13:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .