I'm encountering a problem with KM Version 11 with a macro that works fine in KM Version 10. (To test, I've put it the macro on another machine and reverted back to version10.2 It had been failing on that machine until I reverted back to the previous KM version.) I've spent much time trying to figure out what was causing a macro to fail before posting to this list and I've isolated the step that fails in version 11.
Basically, I have macros that are triggered at set times to download files using CURL or WGET in terminal. Some of the macros use terminal commands to subsequently unzip or run other routines.
I have other files that I download on a timed basis too and I have it set everything up so that if a macro takes too long, KM send a "quit application" ( in this case, the app is Terminal) command. Terminal sometimes will give a notification, "Are you sure you want to Terminate running process" if it's running a routine.
--> To handle this situation, I have KM perform a "forced quit" on the application (Terminal) if it's still running after a short delay.
"Force Quit" an application is what's failing in version 11. At least as far a Terminal goes. The same macro has worked fine in version 8 9 and 10.
Here's a screen shot of the macro that fails in 11:
I use several Macs for downloading files and even though Peter generously allows people to use one license on 5 machines, I routinely purchase three licenses to support Peter's incredible work. I've done that with version 11 and I'd hate to roll everything back to 10 to get everything working again.
Anyone else encountering this issue?
I should add that Quit Application (in this case Terminal) works if Terminal is running something simple, but where Terminal is 'busy' with a more advance routine, it will display a message confirming if you want to quit and that's where "forced quit" fails in version 11.
Can you make the simplest macro that demonstrates the issue and post the actual macro so I can try to duplicate it.
It'll be in a few days, because I currently have a lot of Terminal windows open and I don't want to force quit it on my Ventura Mac and my other Macs are running different versions of macOS.
That gives us a lot of insight into your development environment. Interesting. I hadn't really thought much about how many computers you need. You don't need to reveal any trade secrets, but how many computers do you own in order to develop and support Keyboard Maestro?
I have one primary development Mac which is running Ventura and the previous version of Xcode, since I have no plans to update either of them while I'm in the middle of a major release. I expect I'll update both of them in a few months, maybe early next year.
I have a laptop that has Sonoma on it for testing that.
And I have a server Mac that does things like Backups and such, and I leave that running the minimum version Keyboard Maestro supports so I always test Keyboard Maestro on that each time I do a release.
Then the rest of my family have various Macs that sometimes get roped in to testing all with various different versions of macOS.
Thanks for that information. I'm not a tax man, but if your family spends time helping you, you probably could pay them and deduct their salary as an expense.
Make sure you have a really good offsite backup mechanism. I don't want to lose KM due to loss of files.
Hi Peter,
I've written directly to you about this issue. I wish I could send a simple macro, but basically, I'm using Terminal to run an essential weather model C-Fortran program called wgrib2. (wgrib2 is used to slice and dice weather model data.) Often the data is gigabytes large and it's during this wgrib2 background process that force quit no longer terminates. I don't think I can provide the giant files to demonstrate and furthermore, wgrib2 has to be compiled on your specific machine; it's not an off the shelf application.
Force Quit worked flawlessly in KM 8 9 and 10 with this. Only you know what changes, if any, were made to KM 11 under the hood.
As I wrote to you earlier, I also run this on an old mac mini running Mojave. My macro's Force quit worked in 10.2 but no longer 11. Rolling it back to 10.2 and things worked again. So I'm pretty sure it's not a Ventura-specific issue.
I'm sure I can figure out some work around if I absolutely need to but I'd love to discover what has changed its behavior in 11.
Hi MrPasini,
First, Thanks for all your contributions to this forum. I find them so useful!
The issue here is when Terminal is controlling a background process that force quit longer works in 11. I've provided more details lower down in this thread. Its not a Ventura issue. My Mojave based macmini is having the same issues. I had to roll it back to 10.2 and things resumed to normal.
I suspect that the dialog displayed is a system level dialog to terminate the process, not an application dialog. Nonetheless, Force Quit on Terminal always worked in previous versions.
I tried to have Keyboard Maestro send a keystroke return to the same dialog instead of a force quit. But I knew from previous experience it doesn't work. And it didn't.
To see if a true force quit would work, I selected it from the dock with the option key down and it did.
So somethings gotta be different where KM 11 is not really sending a force quit to Terminal here as it did in 10.2
Apparently, the condition "This (Terminal) application running" is perhaps not true, but I'm open to a good explanation what's really going on (or what's not).
--> To have it Terminal quit, I'm going to have to always do a force quit to avoid that system dialog box that doesn't respond.
So I'm going to have to carefully review the "What's New" in 11 to see if I encounter other things.
One thing, that I'm not getting my head around- What's the difference between "Assert that Conditions are met" (Terminal running) verses the conditional "if then" that I used, "If Terminal is still running", do this...
Or was the crux of the problem with the Time Out/Abort Macro behavior on the first command "Quit Application (Terminal)" ?
Ok, I see that the crux was the "Time Out/Abort Macro" (1 second) "gear setting" on the first Quit Application (Terminal) was the real issue and my code works otherwise if I use the conditional.
Basically, Assert is a simplified If…Then (it always aborts if the condition is not met, whereas with an If…Then you can choose what you want to do). I just took it for the test macros because it's simpler, it is not related to your issue.
Or was the crux of the problem with the Time Out/Abort Macro behavior on the first command "Quit Application (Terminal)" ?
Yes. When you create a new Quit action, it has these timeout settings by default:
That's not what you want for your use-case, because it stops your macro in the tracks, since the Terminal's confirmation dialog makes the action fail. (I.e., with a confirmation dialog, the action waits for 20s and then aborts the macro. It would work as intended if the Terminal quits without confirmation.)
It works fine for your case if you remove the Abort (and the Notify too) and set the timeout to something short (1 or 2s, for example).
Thanks to the timeout you don't need a pause afterwards and can immediately run the Force Quit.