1 person found this helpful
+1 vote, except I didnt understand about the "exclamination sounds" - is that a Mac thing?
I'm presently working on a sidekick app / plugin combo, a.k.a. a distributed plugin (communication via xmlrpc, app accesses lr-previews...). The most recent change I made was to be able to commit database changes to lrcat directly by automatically closing Lightroom, using sql via python script (app side), then restarting Lightroom. Its messy, but is one way to delete photos, do instant imports, update metadata, rearrange stacks... If you did not want to go whole hog with the sidekick, you could still borrow some of the concepts. For example:
- Have your plugin write the SQL needed to make the changes, or just save instructions in non-SQL form.
- then have a simple script which submits the SQL to the lrcat, but first loops while polling for Lightroom to free up the database.
- Start that script via plugin.
- Kill Lightroom by LrTask.execute-ing a kill command.
- The script, after detecting the database is free, can then update the database, and restart Lightroom.
Using this technique a plugin essentially has complete access to the lrcat database, albeit not exactly seamless.
You can experiment on a test catalog to get your SQL together before embedding in plugin/script - the database is quite easy to figure out if you are willing to spend a few hours with an sql client app...
Thanks for sharing valuable ideas. Yesterday I finnally faced with the need of SQLing. And I'm still struggling with it. By any chance, do you know how to stack images with SQL? I tried to meddle to "Adobe_images" table, but all what I got is empty cell in Grid in place where the stacked image should be.
p.s. «Exclamination sounds» — I mean audiable notification when importing task is done. If my plugin imports 10 images with catalog:AddPhoto(), I get 10 consecutive «beep» sounds. Maybe there is workaround?
p.s. Of cource good API should eluminate the need of all these kluges.
No idea how to do stacking via SQL, but one way to reverse engineer, is to query the database before stacking, then again after, and compare the difference.
Stacking/unstacking photos. Why: as example, I made plugin, grouping burst-shooted images, with delay between shoots less than a second. Lr does not allow to setup autostack for fraction of seconds, but plugin can do it. If the proper API routine will be provided.
Do you know that catalog:addPhoto() can stack photos? I've used it, and it works as advertised (though it fails silently if you try to stack photos in different folders). It may not completely satisfy your need, since it only lets you stack when you add the photo to the catalog.
Yes, but it stack only newly added photos, isn't it? I'm using the catalog:addPhoto() call after moving photo, but it doesn't seem nice.
Yes, but it stack only newly added photos, isn't it?
Right, it will only stack the photos that are also being added to the catalog.