I want to loop until the number of files on the desktop change. While iMovie is exporting, there are x number of files on the desktop. After the export is complete, there are (x-1) files on the desktop. (This I have proved)
I want to sound an alarm when this happens. I’m trying to compare the before file number and the after file number in a loop, and then exit. I’ve tried Repeat, Until, and While. I’m getting loopy myself after working on this for a couple hours.
First an Execute Shell Script action counts the number of files on the Desktop and saves the value in the variable local initial_count.
Then for each loop in an Until action, the macro pauses for the desired duration (in this demo, it is set to 1 second for test purposes only; you would want some multiple of 60 seconds, I presume) and then stores the current count of files in the variable local current_count.
The loop terminates when the current count is one less than the initial count.