Skip to main content
Known Participant
December 3, 2013
Question

programmatically force Lightroom to sync metadata

  • December 3, 2013
  • 1 reply
  • 1455 views

I want to automatically accomplish "Sync metadata" for a photo from within the Lightroom SDK (that is, programmatically).  Is this possible?

This topic has been closed for replies.

1 reply

areohbee
Legend
December 4, 2013

There is no SDK method to "sync metadata" per-se. So, I've done it in a variety of fashions, tailored to the situation...

Some metadata you can sync by reading it using get{type]Metadata function(s) and write it via setRawMetadata, other metadata will require xmp tricks, or exiftool...

PS - I don't think you can force sync'ing via UI (by stuffing keystrokes) because stuffed keystrokes can't see their way to a dialog box, and in this case they would need to. If you figure out how to aim a keystroke at a dialog box, I'd love to know about it.

Rob

Known Participant
December 4, 2013

just to be clear, i want to make sure the metadata makes it all the way to the sidecar files (raw images) and IPTC fields (in a jpeg).  it's not clear from the documentation where the "raw metadata" lives -- but i assume it lives in the Lightroom SQLite catalog, not in the images, and that syncing moved it to the sidecar and IPTC fields.  are you saying that in some cases setRawMetadata sets data all the way out to the sidecar/IPTC fields? 

specifically i want to set keywords there, and  i know keywords do not move to sidecar/IPTC until i initiate a sync from the Lightroom menu (that is, non-programmatically)

johnrellis
Legend
December 4, 2013

i want to make sure the metadata makes it all the way to the sidecar files (raw images) and IPTC fields (in a jpeg).

Ah, that's what you meant by "sync" -- it's such an overloaded word in Lightroom.

You can try the undocumented photo:saveMetadata().   Search this forum for a little feedback from others who have tried it.