As a side note, it took me a while to find "Activate" for an application. I'm use to the terms open or launch.
My question is: I activate Quicken and then I put Pause until Quicken is at the Front and then the next action was a Type %R Keystroke but my Mac would beep and Quicken would not get the keystroke. So I added a Pause for 3 seconds. This work but, obviously will be fragile. Is there are better way to do this?
You could try the Pause Until action with the Menu condition set appropriately - see condition:Menu [Keyboard Maestro Wiki] to wait until the desired Quicken menu option becomes available.
That is worth knowing. I suppose it must be because Keyboard Maestro doesn't have to search for the menu item in every single menu until it finds the menu item.
I just discovered this a few weeks ago from somebody's comment here, and went through all of my macros that had this feature (around 115) to change them to path... and it really did make a noticeable difference.
@pedz, @ccstone, I've had a few cases when a macro would sporadically fail (i.e., move on too quickly) unless a third condition was added.
The text: %WindowName%1% is not empty
@ccstone, thanks for the reminder. Here's an updated example that uses the suggested with path specification.
Finder ➤ Show View Options Macro (v10.0.2)
DOWNLOAD Macro File: Finder ➤ Show View Options.kmmacros (17 KB) Note: This macro was uploaded in a DISABLED state. It must be ENABLED before it can be run. If it does not trigger, the macro group might also need to be ENABLED.
I am making progress but I feel like I need to document some of my observations. The most bizarre is via Quicken. I hope I can generate a good test case. But the script is going through a sequence of dialog boxes and then it has a button in a dialog box "Choose CSV File to Import...". The action I had was to push the button and it successfully pushed the button because the open dialog box comes open but then the action would stall and time out because it said there was no button. To rephrase (because it is hard to believe) the action found and pushed the button but then stalled and timed out because there was no button.
I've also had trouble finding Menu items. Maybe there is some hidden text or something some times. I will try to find and document one of those cases too. I think that was with Numbers which others are more likely to have.
In particular, since regular expressions are supported, you might be able to find the menu items in question. For example, in the example I provided, rather than entering Menu Item: Show View Options one could enter: ^Show View
Thank you all again. I am surprised at how slow my learning curve is. I'm just not really paying attention.
Is there a way to lock a macro so I can't accidentally change it?
Also, is there a way so that the default timeout is something within my lifetime instead of 99 hours? e.g. 2 seconds is what I'm picking at first and then adjusting if necessary.
Not an individual macro, no. You can select Stop Editing Macros from the View menu but that applies to all macros. What I do when I don't want to inadvertently mess up a macro is collapse all of it's actions, and then group them all together and collapse that group, giving it a custom title like "don't screw around with this because it already works great and if you change something you're just going to break it and then you'll be kicking yourself the rest of the day"
Not that I'm aware of (although some hidden preferences can be adjusted via Terminal, I'm just not sure if this is one of them). But you can adjust the timeout on an action, and then add it to your favorites via the native favorites feature of KM10 or via @DanThomasKMFAM Favorites macro.
Waiting for a menu item to become available is working great for most apps. Thanks everyone!
However it's not working as expected for (surprise) Microsoft Teams.
I'm running the "new" Teams, and waiting for "Microsoft Teams Help" menu item.
The trouble is that the app menu bar becomes available almost immediately when the app is opened, but the main application window doesn't appear or become active until several seconds later (over 10s in some cases – I tried adding a "Pause for 10 seconds" action but it's not long enough!)
Does anyone know of a way to reliably detect when the main window of the new Microsoft Teams is available? I've got a macro that opens Teams and sets my status to "Available" using the search/command bar at the top, but beyond a long pause (yuck), I haven't found a reliable way to wait for Teams.
I tried waiting for "Cast", which is available in the "three dots" menu once the main window appears, but KM doesn't detect it. "Quit Microsoft Teams" becomes available a little later than "Microsoft Teams Help", but I'm not sure if it activates after the main window or not.
Absolute worst case, I could take a screen cap, use Object Character Recognition on it, and confirm that the snippet contains the text from the expected search/command bar. Oddly, this wouldn't be that much of a stretch – I've used Keyboard Maestro to automatically capture text from a Zoom chat window and use it to play a game locally, a whole other goofy project. And this would be a direct automation of how a human determines that the application is available. But if there's a cleaner way to do it, I want to find that! XD
Cheers all
p.s. if anyone wants a copy of that "let people in the Zoom chat type game commands" macro, let me know and I'll throw it up on GitHub.
Does Pause UntilFront Window of Microsoft Teams Exists not work? Or if there's already a window that exists, are the window names different so you can Pause UntilAny Window of Microsoft Teams contains [name]? I don't use Microsoft Teams, though, so maybe it doesn't work with Keyboard Maestro the way I would expect.
Because that isn't an actual menu, in macOS/KM terms.
You're going to have to use image detection, so you might as well use it for your "Pause Until" and to open the menu. Make sure your screen shot has a slice of your avatar to increase uniqueness, but don't include the (changeable) status label. Once the drop-down is open you can use C and Return to open the "Cast" window.