Macro failed, but performed action...?

UPDATE: I was able to workaround this issue by adding the action to create a new folder right at the beginning of the macro (thanks to @Nige_S), but I would still like to understand what the issue is, if anyone knows what's happening.


I have a macro with an action that creates a new folder inside the Save As window.
The macro seems to work, because the New Folder button is pressed, but then it shows an error saying it didn't find the button:

As you can see on the left, the window to create a new folder shows up, so the button was pressed. Why am I getting the error message on the top right?

That's quite bizarre, isn't it! I'm assuming there's nothing untoward with your macro, but maybe post it if you want me to double check for you.

This is the other macro where I replaced this section with the New Folder action, because it just worked.

But maybe you can replicate it. It was just a simple Save As macro.
Go to file, click the Save As option.
Wait for the Save button to be enabled
Press the New Folder button

That's it...

Ah yeah, d'oh! I already replicated it on the other thread!

Is it the same for you in other apps too?

What do you mean by "other apps"?
You mean using the Save As window then the New Folder inside a different app?
I just tried with Hazel, I guess. I can run some tests tomorrow with other apps

Yes that's what I meant. Just in case Hazel's window visibility wasn't standard. I'm clutching at straws though.

Without seeing the exact macro it is hard to know, but the API to click a button can be synchronous, which can lead to failures, or the app can report a failure even though the button was pressed. The error message should not generally then by β€œfailed to find” though, but that could just be an error in the error message, or something else could be going on.

@noisneil
I just tried with TextEdit, same result. See the macro below.

@peternlewis
The issue is that KM doesn't move on after that. Even if the error was related to the error message, the flow should keep going, right? I guess that's what you mean? Anyway, check the macro below and you can test it yourself, see if you can find what's going on

TextEdit Save As - New Folder.kmmacros (7.7 KB)

@iamdannywyatt, your macro fails even earlier as you aren't specifying a path:

Screenshot

Regardless, I made my own version and it does indeed fail when trying to enter text into the New Folder dialog. I turned on notifications and didn't see any errors, oddly enough.

I replaced Pause Until "Create" Buttton Exists with a simple 0.5sec pause and it still failed.


Unrelated side-note: I've mentioned this a few times, @peternlewis, but Go To in Open/Save dialogs is buggy for me, regardless of the method used. Seems like KM's pause function interferes with the navigation, which will hang and go nowhere about 40% of the time. I noticed when trying to automate Type To Siri that while KM is pausing, Siri's notification animation glitches, so it made me wonder if there was some kind of interplay.

I honestly think that there's some kind of conflict between KM and your OS (or something else), because you are experiencing 2 issues that I'm not:
1 - Using ~ is a path. It's the Home folder and it works properly on my end.
2 - The Go To has been working for me as well, no issues at all. I've been using it exclusively instead of other options that I used in the beginning.

You are even having issues with the notifications not showing up, even though they are turned on, so there's a 3rd issue there that I don't experience.

I think for the time being I will stick to creating a folder "externally" as my first action, as it's working without any issues :slight_smile:

1 Like

You're right. Sorry, I hadn't had my coffee.

Quite possibly this is specific to my system, but I also noticed the Type to Siri glitch, which only occurs when KM is pausing.

Again, this was pre-coffee. I forgot that I'd set notifications not to show "Action Failed" errors using Terminal commands a long time ago.

I'm all caffeined up now. :coffee:

1 Like

hahaha it happens to the best. Gotta wake up properly before trying to make some important decisions.

Good to know some of those issues are not real issues anymore

The macro does not work in Monterey where the Command-Shift-G behaviour has changed.

This does not make any sense and indicates a fundamental misunderstanding with what is going on. A Pause action cannot interfere with anything, and a Pause action will always pause the specified time and then continue.

Whatever is happening, it is not the Pause interfering or the pause hanging.

Same - whatever is happening, it is not the Keyboard Maestro Pause that is the cause.

Ok, so it's not the pause. All I do know is that navigating in dialogs (by using command-shift-G or typing ~ or /) and typing to Siri works perfectly unless KM is doing it, and when it fails or glitches, KM is pausing.

As @iamdannywyatt suggests, it might be something specific to my setup. I don't want to hijack his thread; I just wondered if you'd ever come across it before.

1 Like

I'm still using Catalina.
So you mean that with Monterey, Command-Shift-G no longer means "Go to..."?

The β‡§βŒ˜G Shortcut still works in Monterey. But there is no "Go" button in the resultant dialog so your pause Action in your Macro will not work (and is not needed) in Monterey:

2 Likes

Oh I see.
So you can still use the shortcut, but then need to hit Return/Enter? If there's no Go button, is there any other button or does it only rely on the Return/Enter key?

Again, I'm on Catalina, but it's good to know these things to maybe think ahead of time when creating macros to make my life easier in the future when I upgrade.

1 Like

Yes, that's right. It still works with the shortcut and "Enter" and without the pause Action. For example:

2 Likes

Thanks for clarifying! :slight_smile:
We can still use the Pause Until by using the window as an image, which is what I use when there's no button or anything like that