I have a Macro to save webpages in a row. There are many pages, so it takes sometimes about 30 - 50 mins.
This Macro hangs after some periods of time (15-30 min).
I tried:
different "pause" times and different "pause until" conditions between actions
different actions like "select save as in the menu" vs cmd+s
prevented Mac from sleeping with with Amphetamine App
reinstalled chrome
It's interesting that this Macro mostly "awakes" after hanging, when I activate KM application switcher. Is it possible, that KM gets inactive after longer periods of time?
Pause Until a menu is enabled is quit a complex accessibility API action. It involves a lot of taking to the accessibility API, scanning through the menus looking for the specific menu item. It may be that you are running up against some sort of issue there, perhaps there is a leak in the API code, or something like that.
There are a couple things you could try:
Use “A menu item with this path” instead - that goes right to the menu item, so requires a lot less interactions.
Use a Repeat Until loop with a pause in it instead of a Pause Until, that would reduce the pounding on the accessibility API which might help.
Periodically in your macro add a long pause (eg every twenty pages or whatever) or even quit and relaunch the web browser.
Consider clicking in the menu bar which will poke the menu system
Set a reasonable timeout time on the action and then detect the failure and take some sort of corrective action - click the menu bar, relaunch the web browser or something like that and then try again. Or perhaps just assume that the Save Page As menu is enabled after a maximum amount of time and set that as the timeout and carry on, but make sure you detect a future failure.
I can't find any topic here about using "A menu item with this path". Could you please explain how to use a menu item path.
Is it always necessary to add long pauses by long macros or only when they don't function properly? If I build macros, I try to make them as fast as possible (for example by renaming of files). Can such fast macros harm my Mac?
Could you please give an example. I don't understand what and when should I click in the menu bar to poke the menu system.
IT is documented in the Menu Condition which you can get to directly by holding down the Option key and clicking on the New Condition button in the Pause Until (or other Control Flow) action.
No. Sometimes applications can take a while to perform actions, and sometimes they can slowly get behind if you continue to throw actions at them at rapid fire, and sometimes they can simply not expect to get a rapid sequence of users actions with no let up. In any of these cases, pausing to get the application as chance to catch its breath or perhaps even quitting & relaunching may be required.