How to trigger the "Create New Folder" window?

I have a macro that opens the Save As window and then I want to create a new folder. When I have it set to click the New Folder button, it opens the window to name the folder and create it, but KM doesn't seem to recognize it. For example if I have an action to pause until it finds a "Create" button, it doesn't do anything after that.

Any tips?

Use a "Create New Folder" action before you "Save As...", and avoid the problem completely?

1 Like

Awesome!!! Like a charm! :slight_smile:
Do you know the reason why KM doesn't "see" that window?

No -- and, frankly, I don't care!

KM's GUI interaction amazes me. But your macros aren't dithering users, only realising when they get to the dialog that they would like a new folder, so don't think you have to emulate them. If it can be done programmatically, do it that way -- if only to save yourself a lot of work when Apple change the GUI enough to break your carefully crafted image detections!

My goal was to just understand if there was a logical reason that could affect other scenarios, not just this one. That way, if another similar thing happened and there was no work around like this one, I would know what was happening.

But yeah, if this works, that's what matters :slight_smile: Really appreciate the tip!

Then it would help if you posted the macro -- or at least the relevant part of it -- so people can see what you are trying to do and replicate it for themselves.

Scratch that -- I'm seeing the same behaviour in TextEdit->Save As... and "Click'New Folder' button". Tested in both macOS 12.3.1 and 10.14 I don't know if this is particular to the "New folder" button or also happens with other buttons.

All I can suggest until the clever kids chip in is that you either create the folder first or suppress the alert/abort using the action's settings.

Yes, I just went with the New Folder action.
Maybe someone can explain what's happening with the other scenario, but for now I'm good with that action. Thanks!

No such issue on Catalina. @iamdannywyatt, are you pausing to wait for the New Folder button to exist, as below?

I ended up replacing that with the New Folder action, but I believe I was using the Pause action, yes.

And the weird thing is that it was clicking the New Folder button, but then it would not let me create the folder, because it was not doing anything in the New Folder window. Actually it was showing me an error as if it didn't click the New Folder button at all. I created a thread about it:

1 Like

Are we seeing the same thing? It isn't that the "New Folder" button isn't pressed -- that works fine and the "Type a name" dialog comes up. But if you don't do anything at that stage, just leave the dialog on screen, KM will then report that the "New Folder" button was never pressed.

It's as though it's a two-stage process, with "Press button" going through but KM not getting "Button has been pressed" back. If you "Cancel" the "Type a name" dialog quickly enough then the macro continues without error, and I guess it would if you "OK"ed it too.

If you watch the "New Folder" button it remains highlighted while the "Type a name" dialog is present. What that really reminds me of is Hypercard's (that dates me!) "Button Down" and "Button Up" events -- like KM is waiting for an "Button Up" event to know the button has been successfully pressed, but "New Folder" doesn't return that event until the new folder has been created (or the naming dialog cancelled).

Ok I'm up to speed now. Does seem strange, doesn't it. I have KM notifications off, so I've never noticed it but if you're both getting the same result there's clearly something odd happening.

Exactly! :slight_smile: