Increase Maximum Number of Files That Can Be Dropped on a Macro?

I have made a simple a macro that trashes files that are dropped onto its palette icon (Trash File: %TriggerValue%)

It works great for up to about 25 files, but any more than that it just does nothing.

I've experimented with For Each loops, but still nothing when there's more than 25 files.

Is there a limitation of the number of files, and if so, can it be increased?

Looks like I can drag 50 files using Keyboard Maestro 10.2 on macOS 10.14.6.

Keep in mind that the macro runs separately for each item dragged – and this makes doing batch operations a bit tricky.

Personally I don't find dragging that many files to be efficient. You have to select all of them and then drag and drop them...

Since Keyboard Maestro can operate on the Finder-selection it makes more sense to leave off the drag and drop part to me – but YMMV.

@peternlewis?

Yes makes sense. I should have mentioned that I'm not dragging the files from Finder, but from a (free) audio file manager called ADSR Sample Manager. The software doesn't have a delete function, but since it's made for dragging audio files into software like Logic, it turns out dragging to KM works too.

Thanks for the info about the macro triggering multiple times. Indeed, the log is telling me "More than 50 simultaneous macros - aborting everything"

I'll see if inserting a delay helps...

1 Like

Are you firing off a sub-macro/routine too? They count towards the overall total.

You can increase the maximum simultaneous macros number with a "hidden" preference, eg to make it 200 go to Terminal and

defaults write com.stairways.keyboardmaestro.engine MaximumSimultaneousMacros -int 200

...but that may be delaying an inevitable problem/crash :frowning:

You might be able to do something like a "collector" macro that simply stores those references into a global plus a timer macro fired by the first "collector" instance that monitors the global and, if it does't change in over a second, kicks off your "main" that does whatever using those references (and clears the global, ready for next time).

3 Likes

Yes, you are hitting the 50 macro emergency abort (it would only be 25 files if you are executing a submacro, so I'm confused by that).

Adding a delay (or anything else) wont help, because the macros are all going to be executed internally by Keyboard Maestro and when it hits 50 it's going to cancel everything (and maybe then the remaining ones will still be started, I'm not sure).

Increasing the limit as @Nige_S described will increase the number of files (and avoiding the submacro would double the number).

I'll look to see if I can adjust the behaviour of the action to more drip feed the files if a large number of files is dropped.

2 Likes

This is resolved for the next version. Keyboard Maestro will initially start about 20 macros (scaled up for larger values of the maximum number of macros preference) in this case, and then as the macros complete it will trigger more.

This only applies to this specific case of dropping a large number of files on to a palette entry.

1 Like