Does anyone know if it is possible to detect when the Console.app completes the initial load of a log file? It would also be helpful to be able to detect the end of a Action > Reload.
I'm working on an updated version of a macro that opens the Keyboard Maestro Engine.log and uses Edit > Find > Find... to highlight a particular failure or timeout. This sequence often fails if the initial load has not completed.
Yes, it seems that the duration of the actions you suggested might closely correlate with the Console.app load, but unless I'm missing the point, isn't it likely that the Console.app load would be longer since there is additional overhead associate with the app?
With that said, this would be better than pausing some fixed duration:
Open Engine.log; that opens the Console.app.
Run your actions, calculating the duration.
Add some proportional fudge factor and Pause for that additional amount of time.
That's a fair point. I have no idea. But until you test my app to see if it ever fails, we won't know. In my general experience, once a file is unlocked by any app that was writing to it, it is considered accurate/available for others to use.
Yes, I'm using a shell script to locate the latest failure or timeout. But there's one branch of the macro (Main Dialog, Log button) where I want to open the Console.app and use Edit > Find > Find... to highlight that lastest failure or timeout.
@Airy, @mrpasini, @tiffle, thanks for your suggestions. After several failed attempts I finally found a menu combination that occurs only after the log file is fully loaded.
In this case, a more appropriate designation would have been Kludged.
Very cool! You've gotta love these Keyboard Maestro Version 11 enhancements!
Unfortunately, MMDV; the Console.app returns %FrontDocumentPath% almost immediately upon opening, well before the Engine.log is loaded.
So, for now, I'll need to stick with my kludge. (Actually it's a bit uglier than the actions I shared above. I've since discovered that I needed a provision if the current macOS display resolution is low. The @&#$?&! Console.app doesn't display the Search field if the window width drops below a threshold; thus the menu enabled/disabled differs. So now, the macro checks the screen resolution and if it's low, maximizes the Console.app window during the necessary actions, and then reduces the window to the left half of the display. Crazy, right?)
@tiffle, I'm sure glad you did. I suspect that this approach will come in handy when developing future macros.
Does anyone else find it ironic that a simple approach works for Excel but not for the native macOS Console app? Has the world spun off its axis?