Guidance on building a workflow based on processes which are variable in length

For both my general understanding, and also to be used specifically in one my of Macbook Maintenance WFs, I have been trying to determine how KM may determine that an application process has been completed. Specifically this example pertains to a WF where I call the Mac App 'Cleanmymac' and then begin the 'Smart Scan' by triggering return. Based upon various conditions the scan may take different amount of time to complete. The next step in the WF would be to run the cleaner (as the initial scan only gathers data), but I'm not sure how KM would be able to determine when the scan is completed. I can build in a place-holder time pause, but this didn't seem efficient. Thank you for any guidance...

Hey Bry,

How does Cleanmymac indicate it has finished a task?

-Chris

Chris,

Thanks for the reply! That is a perfect question and I had the same logic - try to find what had changed (an updated attribute or other indicator) and then use this as a condition within the WF. I am attaching two pics, one which shows the scan and other other which shows when the scan is completed. The only difference seems to on the app pane itsself, but these are not links and the button funtions goes from pause to run (pause scan, run scan)...

Hey Bry,

Do any of the menu items change during the scan?

For instance – is there a “Run” menu item? Is it greyed-out during the run?

If so then you could use a pause-until action with a menu condition.

If nothing else you could use the Found Image condition to periodically look for the image of the “Run” button in the app's window.

I would NOT use the Pause Until action with a found image, because it's very processor intensive.

Instead I'd used a time triggered macro to scan for the image every x minutes (whatever is a reasonable period).

-Chris

@ccstone - thank you so much and apologies it took me sometime to circle back. I tried your suggestion of using the 'pause until' along with conditional UI and was able to process in the workflow. Plus, this macro is extremely helpful and immediately opens up a multitude of other great workflows which I'd like to try...

1 Like