@ifpath & "*" placeholders

I'm using some @ifpath command, like this:

@ifpath:(H:*|K:\Bilder*|L:*|M:*)

It seems, like for K:\Bilder* the "*" doesn't work as expected, because i see the "else" clause happening. If i shorten that part to K:\Bilder, it doesn't work for the subfolders. Is this maybe a glitch in DO12? I can't compare it at the moment.

K:\Bilder* won't match K:\Bilder because there's no \ on the end. It would only match things like "K:\Bilder" and "K:\Bilder\subdir..."

K:\Bilder(|*) would match K:\Bilder and subdirs (while not matching K:\Bilder2 like K:\Bilder* would).

Try @ifpath:(H:*|(K:\Bilder(|*))|L:*|M:*)

Thank you, Leo. I have changed the code like you have suggested, & it works now as expected, in all cases.

Hmm, no, it does not work always, sorry. I get the confirm when i'm in the root of N:, trying to delete files or folders. So far so good. As soon i am in the first level of subfolders, the warning fails. How can i get the confirmation in EVERY level of subfolders, for all files or folders?

For example, i want to have the dialog for every single location under N:, or, as an other example, every single file or folder under L:\Web? I have tried "N:*" or (N:(|*)), but there are still items left, where i don't get that warning.

N:* would match everything below N:*

But N is not in your @ifpath code above, which is confusing me.

What is the full button code?

I had changed that code to include several drives:

@ifpath:((H:(|*))|(K:\Bilder(|*))|(L:(|*))|(M:(|*))|(N:*))

But i don't know, why i had the impression it wouldn't work in the simple version like N:*, maybe i had some parenthesis wrong, missing one ")". Now i have changed it back to

@ifpath:(H:*|(K:\Bilder(|*))|L:*|M:*)|N:*), so it works. Sorry for the confusion.

If you look at the wildcard for N:*\ on its own at the end of the first one, which is different to all the ones for other drives, it should become obvious why it was not working as expected.

With the second one, things look more correct but you still have too many brackets in there. Take out the extra ) after the M:* part, so it is like this

@ifpath:(H:*|(K:\Bilder(|*))|L:*|M:*|N:*)

The details matter. :slight_smile:

Yes, it looks much better now, after i have cleaned up some brackets. With lots of @confirm & @ifpath commands it tends to get confusing. Maybe we can have some automatic highlighting in some future version? :wink:

Scripting is where our time is focused, in terms of newer and better ways to do conditional logic and dialogs in buttons. I doubt we will be investing much time on the legacy @ifpath / @confirm stuff, which is best suited to simple things that would not benefit from it.

If you're doing anything complex, scripting is the way to go.