Darktable for Mac: unable to add lua scripts outside of app contents folder

Hi. Newcomer here so my apologies if this topic has already been covered (I searched but didn’t find anything).

On the weekend I used claude.ai to develop a lua script to sync the folder containing the currently visible images in lighttable after exporting another version of a photo (tiff for example) or after having another app add a photo to the folder. The script works really well in lighttable but only if I add it to the contrib folder within the contents of the darktable.app on my Mac. I tried following the instructions to add a lua folder in my darktable folder under .config and also added the luarc file with the “require” line added. Restarting darktable after doing this removed all script controls from the left & right menus. Removing the luarc file fron .config fixed this but of course darktable did not see the script in the lua folder.

I added the script to the contrib folder within the app and it worked perfectly. I also modified the external editor script to allow for exporting CR3 and DNG files to other apps such as DXO Photolab for using its DeepPrime noise reduction. Using the open in external editor script, applying the DeepPrime, exporting a dng file, then running the sync folder script worked really well to instantly add the exported dng file to lighttable. However, every time I install a new version of darktable, I’ll have to remember to re-add the scripts as the new install erases everything inside the darktable.app file.

I thought perhaps the inability to use the lua scripting in the .config folder was because I was running the latest nightly builds of DT 5.5. However, reinstalled 5.4.1 and trying to add the luarc file and scripts in a lua folder in the .config folder resulted in absence of all script controls.

I also noticed that the script manager script seems inaccessible even when I have scripts working. I changed the dropdown menu within the scripts control to the tools scripts and only three of the four tool scripts installed actually show up with the script manager script being absent.

Is there something I’m missing in the steps to get things working? I’m loving darktable’s abilities and would like to get the scripting working to its full potential.

You can create a folder, ~/.config/darktable/lua/MyStuff (doesn’t have to be MyStuff, it can be whatever you want) and drop your scripts there.

When you start darktable the next time, it should just pick it up and scripts should show a new category in the dropdown.

Thanks Bill, that worked perfectly. I noted that it didn’t need the luarc file that’s mentioned in instructions around the net.

I also tried moving the script_manager.lua to the folder I created inside .config to see if it would work there but DT still doesn’t seem to see it.

I’ve still go lots of lua exploring to do. For example, I have the open in gimp script installed and I have Gimp on my mac but the script doesn’t seem to do anything or add any control to open a file in Gimp.

The GIMP script adds a new target storage to the export module, edit with GIMP.

The scripts are bundled with darktable starting with 5.6, which will be released in a couple of weeks. Part of bundling involves starting script_manager from the system luarc file, so a local luarc file isn’t required. However, a user luarc file can still be used to start things if desired.

Thanks Bill. I’ve chcked out the GIMP target storage. I haven’t yet really done anything with GIMP but I’ll probably let my Photoshop/Lightroom photography subscription expire so then it’ll be time to learn GIMP. I did notice that by default GIMP seems to want to save an xcf file, which darktable doesn’t support. I take it, a user must change to tiff or something DT will support.

As for a local luarc file, when I tried creating one, it seemed to remove all script controls, so I got rid of it and scripts work fine.