Importing Into Apple Photos Using Add Item in a Folder Trigger Problems

I'm trying to automate exports from Lightroom Classic to Apple Photos. I previously used Hazel for this, but I wanted to try using KM to scale down on apps running in the background on my system.

But there are multiple issues with this. Whenever I export a bunch of images to a specific folder under KM's surveillance, using the adding item in a folder trigger in KM runs into issues when I try using a macro to import the images from Lightroom into Photos.

Opening them in Photos (not importing them) via the macro used to work fine – Photos diligently took one photo at a time and imported them. But nowadays, it opens up an import dialog instead, needing manual handling from the user (me).

Importing is another beast – when the macro is triggered multiple times in a row because it is being triggered by each image added from Lightroom, it can cause all kinds of problems. The issue is that I cannot "pause" the macro to wait for Photos to import one image and then process the next one. Or can I? Is this possible at all to achieve? I have tried using Applescript for this, and imports work fine, but I still have the issue with trying to do a bunch of imports simultaneously – and Photos complains about this.

Best case scenario:

  1. Export 1…n photos from Lightroom into a folder
  2. KM detects new items in that folder
  3. KM imports one image at a time into the Photos app

Is there a way for KM to process one thing at a time before moving on? Can this be done? Any hints will be appreciated.

Cheers,
Massimo

Yes, you can do this by using the KM Semaphore actions to control multiple simultaneous executions of the same macro. You can find info on it here action:Semaphore Lock [Keyboard Maestro Wiki]

By default it maintains a queue and permits one instance of a macro to run at a time.

This came up here recently:

By itself it doesn't solve everything for you, but it's a start.

2 Likes

You are a godsend. Thank you so much. This solves a bunch of headaches for me!

Cheers,
Massimo

1 Like