Why Is a Keyboard Maestro Folder Trigger Faster Than AppleScripted Folder Actions?

Just a random question...

I used to have a folder action script attached to my Desktop folder that would open screenshots as soon as they were created. When I moved to a new Mac, I wanted to open them in a different app. Rather than rewrite the script, I just went ahead and created a folder-trigger macro in KM to handle it.

My five-line folder action script usually had a delay of about 1 - 2 seconds before it would open the screenshot. With KM's trigger, it works pretty much instantly.

Why is it so much faster?

Because I’m awesome?

But more seriously, there isn’t any way to answer this, the process between the two is so radically different that either way could be faster or slower. Keyboard Maestro tries to be very efficient in terms of not using resources (CPU/energy) when nothing is happening, but it’s really only a secondary aim for Keyboard Maestro to be efficient or particularly fast when operating a macro. The assumption is that Keyboard Maestro will do its thing way faster than you can in any event.

With the folder trigger, it does depend on your exact configuration too, if you configure it to ignore partial files then there will be a deliberate lag in the action for example. It may be that the Folder Action system has that sort of thing turned on always.

4 Likes

That sums it up nicely.

3 Likes