Had a look around the forum but can't see any obvious solution. I have created a macro to repeat another macro until a folder does not contain anything. I have pasted the screen shot of my workflow below
Macro's run fine, but once the working path is empty it just keeps on going!
I trigger the test macro (in the above workflow) the macro to execute does it's thing on each folder in the working path and moves the folder to another location, it then triggers the test macro at the end of it's flow and starts again.
Using the attached parameters I would think the test macro would stop when no folders in the working path exist. Unfortunately it just keeps going (disastrous) until I cancel the macro.
Anyway, loving the app, if anybody has an insight I would be very grateful.
I could be wrong, but I think the "nothing exists" condition means the folder itself doesn't exist.
I'm not sure how to see if the folder is empty, though. The only way I can think of is to do a "For each" action to see if there's a file in the folder or not. Something like this:
In your explanation above I have completely misunderstood the “nothing exits” term. have tried different variations of if, while, until, etc no luck, this explains why!
Not touched on variables yet so this will be a good intro.
Since you haven't worked with variables before, let me offer a different version:
In the first version I posted, I used "Set variable to calculation". In this new version, I use "Set variable to text". The reason I'm suggesting this second version is because you haven't worked much with variables, and using them as text is usually easier to understand.
Sorry to resurrect this old thread but I can't seem to get it to work in my instance.
I want to loop a set of actions (the highlighted ones) that move image files from one source folder into multiple destination folders. The actions use variables to get unique names from a filename and generate matching folders. Long story. Anyway, that all works and at the end it brings up a KM alert because the regex (which looks for certain named files) isn't found.
So I thought to try and avoid that alert coming up, I could loop it until the folder is empty.
Here is a screenshot of my macro with an attempt to put it all into the correct order DanThomas suggested.
I turned off Notify on Failure for my "Search Variable xx Using Regular Expression" part of the macro and low and behold, no more notification. That feels better.