Ignore issue and keep running macro

Is there a way for KM to keep running a macro even if there's an error?
Here's an example:

I have 10k files in Finder that I want to make some changes to and let's say there are 200 files that based on their path or filename would make KM cancel so then I would have to go and select all files again, run the macro, etc, maybe find a way to filter out those files that were already changed, etc.

So what I would like to do is:
Use a For Each that will make changes to each selected Finder file, but if for some reason it encounters an error, instead of cancelling the macro, it ignores that particular file and moves on to the next one, so it will process all files that cause no errors, regardless.

EDIT: I just tried a new macro and it actually ignores the issues, it just shows the notifications and adds that to the Engine.logs file, but doesn't abort the macro

I am not sure if you are aware of this or not, but in the Action Settings Menu (accessed through clicking the cogwheel at the top right of the action) you can set how the macro behaves if the action fails (if it is an action that can fail, that is). The default setting is usually (always?) for it to both notify and abort the macro if an action fails, but there are individual options for each. As a side note, you can here also set the Action Timeout settings, (for how long the action will be allowed to run or keep trying), and how the macro behaves if an action times out.

Screenshot 2024-03-05 at 17.21.26

In your described situation it is not the For Each itself that would/could fail, but an action within the For Each, so these setting needs to be set for these actions accordingly.

Edit: Enhanced the language and fixed some typoes

1 Like

Yes, I use those settings mostly when it comes to the Timeout.
I was checking the For Each, but that doesn't have it:
image

But as I mentioned, it seems that it does automatically anyway, so I guess that's why it doesn't have that option. I was making changes to a lot of files and when there was an error, it would show me the notification (top right corner) and in the Engine.logs file, but it would keep running the macro.

1 Like

The for each action doesn’t have notify on failure because it doesn’t actually do anything itself. It only contains other actions that do the work. Those actions are what can fail and notify. You would need to track down which action is causing the failure and adjust it’s settings. There are a variety of macros on the forum that search the KM Engine Log and allow you to view/delete the entry and even jump to the failed action. If you can’t find one, let me know and I’ll share mine.

2 Likes

For today's "task", it wasn't a problem that I wasn't able to see which action was failing. As long as I was able to let the macro run and those files that weren't changed, I would have to change them manually anyway, because the folders (or the files themselves) had commas in them and on my macro I was using actions that relied on a variable's index so when KM looked at the path and saw a comma, it was assuming that was the index separator, you know what I mean? Not a lot of folders/files include that, but it was enough to force me to be here the whole time waiting for it to fail to then select more files, not include the offending files, and start all over.

1 Like

The Try/Catch action can be useful.

1 Like