"More than 50 simultaneous macros - aborting everything"

I've been running into this error a lot lately. What's curious is that it seems to trigger when there are far fewer than 50 macros running; I can only get up to around a dozen before I reach the "aborting everything" event.

  • Peter, is it possible to adjust or disable the maximum number of simultaneous macros allowed?
  • What counts as a running macro? For example, let's say I launch a macro that executes a subroutine macro and pauses until the subroutine is done. While the subroutine is running, does Keyboard Maestro consider this to be a single running macro or two? Also wondering if running shell scripts executed by Keyboard Maestro count toward the limit.

Thanks for your help.

Yes, but it is not something that is documented because it is far more likely to be abused than used usefully. In all the complex macros I've ever written I've never hit this limit, and the limit is designed primarily as a safety net to stop a runaway recursive macro.

Every running macro or submacro and each running sub-list within a macro, are all counted as running macros for this purposes.

Both are counted.

No. The Execute Script action is within a sublist or macro, and that counts, but the shell script itself does not count.

Open the Macro Debugger user manual section and basically every line in there is what counts.

Look in the debugger when you are running your complex macros that lead to this issue and see what is going on.

Generally, unless you have recursive macros (that is a macro that executes itself, either directly or indirectly), it is quite hard to hit this limit. And the limit exists specifically to stop a runaway macro that endlessly recurs.

@peternlewis Can you describe the way of changing the max number? I have a macro also running into this problem when sorting files from a folder into 60 different folders. It might be programmed another way to avoid this but its definitely not a runaway macro.

Or how one could trigger a start of the macro when hitting this limit, that would also fix things in my case.

Best Regards
Trond

Can you post your macro please? Users here will likely help you to rewrite it

Sure, here it is :slight_smile: I understand that this kind of brute force method might get me into trouble, but I can supply the list of names and links another way if someone wants to take a look,

Thanks for looking at it!

Keyboard Maestro Actions.kmactions (98 KB)

Well, the good news is that exiftool is pretty powerful stuff. You can do what you need for each case in an Execute Shell Script of one line. Here's the basic concept, which would be entered in Terminal:

exiftool -p '$filename' -r -if1 '$model eq "NIKON D300" and $filetype eq "JPEG"'  ~/Desktop/hmmm -o ~/Desktop/target

We're telling exiftool to copy any file in the source directory ~/Desktop/hmmm to the directory ~/Desktop/target if the metadata says the image was shot by a Nikon D300 and the file is a JPEG.

Your criteria are different, of course.

You don't care about the camera model, you care about the description. And you want to name the output directory based on the description, as far as I can tell.

Phil Harvey has written great documentation and runs a very responsive forum if you start pulling your hair out.

You could plug in Keyboard Maestro variables for each of your descriptions (I believe you refer to them as Firma but I'm not clear on that. And you could loop through that list with a For Each action. But it's wasteful to load exiftool repeatedly to handle one file. That may be why you're having problems in the first place. You don't need any pauses for this.

The command line I'm showing you loads exiftool once and runs through batches of files looking only at the Exif header (not the image data). And since the same command handles the file copying, it's quite efficient as well as fast.

Hope this helps a bit.

NB: If the Description is always the same as the folder name, you would only need the one line exiftool to do everything. If there are spaces in the name you would quote the output directory with single quotes.

There is nothing in that macro that should be using more than a couple of the "50 simultaneous macros", so something else is going on.

The macro would trigger (that's 1), and then For Each would run (that's 2), and then there are two more levels, but that is still only 4.

Unless there is a lot more going on that is not shown, that macro would only exceed the 50 simultaneous macros if you were running in lots of times simultaneously.