9 Replies Latest reply on Sep 1, 2010 2:26 AM by Henrik Eidem Kurka

    Progamming export / import of XMP

    NickCL

      Hi folks,

       

      I'm still very new to this (just bought a book on Lua ) but I want to create something that export the XMP files (so that I can edit them on the road) and import them back to Lightroom. I've been reading the API reference and SDK manual lately, had a feeling that this is not possible but since I've seen some workarounds to achieve certain goals in this forum, thought still worth asking.

       

      So, assuming that this is not possible, here are a few of my ideas:

       

      • Create some keyboard macros to automate the XMP export / import porcess. It'd nice and sweet if it's some simple application I'm dealing with, but with a complex app like Lr there are too many unpredictables and since it's all valuable data maybe this is not a good idea.
      • Create a plug-in that does not thing but generate XMP files using the post-processing part, and then import edited XMP manually. In this case though, I wonder if it's even possible to create a plug-in that will not export photos but only performs post processing.

       

      Would anyone please shed some lights?

       


      Thanks.

       

      Nick.

        • 1. Re: Progamming export / import of XMP
          areohbee Level 5

          Just hit ctrl/cmd-s and Lightroom will export all your xmp. Then 'Metadata Menu -> Read Meta From Files' will import it into your catalog.

           

          This works for ordinary raws. If your files are dng or jpeg you can extract the xmp using exiftool. in the former case (dng) it will be read back in using 'Metadata Menu -> Read Meta From Files'. I'm not sure about the latter case (jpeg) - probably won't import it.

           

          Or am I not understanding what you are trying to do?

           

          PS - I used to edit the xmp all the time using text-editor macros and grep utilities and little mini-apps I would write... to do things not supported in Lightroom. I mostly do that stuff using SDK3.0 plugins now...

           

          Rob

          1 person found this helpful
          • 2. Re: Progamming export / import of XMP
            NickCL Level 1

            Hi Rob,

             

            Thanks for your prompt advice -- much appreciated.

             

            Sorry for not mention it earlier, but I already know how to manually export / import XMP files and extract / modify XMP from a non-RAW file.

             

            What I wanted to achieve is, say I select a group of photos and maybe click a button and Lightroom will export the XMP files to a desired destination so I can grab them and add keywords or titles later / elsewhere. When I finish editing the XMP files the next thing I want to do is to import the XMP to reflect changes in Lightroom.

             

            You mentioned that you're already able to do this kind of things using SDK3.0 plugins, so I assume there are already API in SDK 3.0 for us to do this kind of things? Would it be an Export plug-in or custom metadata programming?

             

            Thanks.

             

            Nick.

            • 3. Re: Progamming export / import of XMP
              areohbee Level 5

              Nick,

               

              Thanks for clarifying.

               

              Well, there is nothing in the SDK to trigger the xmp export / import. The only workaround I know of for that is an autohotkey script, which although a little klugy can nevertheless be a viable alternative. However, the SDK does provide the ability to read just-about everything that goes into an xmp file. Unfortunately, writing it back in is a bit more limited.

               

              The trickiest part, if I'm following as well as I think I am, would be to merge the xmp stuff that changed "offline" with the "online" xmp that may have also changed in the meantime.

               

              How'd I do?

               

              How were you planning to edit the xmp information anyway?

               

              Rob

              1 person found this helpful
              • 4. Re: Progamming export / import of XMP
                NickCL Level 1

                Hi Rob,

                 

                To be honest I just Googled your name and found your web site that contains plug-ins that do similar things of what I wanted to do, this is nice to know because I just wanted to know if there's a way to go around this -- I didn't want to waste my time putting codes that wouldn't eventually give me what I wanted, thus the intention to ask the question in the first place. ;-)

                 

                I have some development background dealing with XML version control and conflict management so merging online VS offline content is okay for me, -- since all I want to do at moment is editing keywords and titles (or any other description fields) maybe I'll just create some CRC from online files, and write any changed values in the offline file back to the online file.

                 

                How I plan to edit the XMP file was to create a XSLT stylesheet that converts XMP files into a spreadsheet so I can edit on the road. If it's too much work I might just create a PHP script that sits on my home PC host the XMP web edit interface so I can edit them from any device with a web browser -- with this method I might not even have to deal with XMP versioning since I'll probably have the PHP to read XMP and write changes in realtime.

                 

                The mortifying part is -- as you pointed out already -- using a keyboard macro isn't really elegant, but guess this is the only way to automate this kind of stuff...


                Thanks.

                 

                Nick.

                • 5. Re: Progamming export / import of XMP
                  areohbee Level 5

                  Nick,

                   

                  You can always harvest code from those plugins too - they are not compiled.

                   

                  Sounds like you know enough programming that once you are up to speed with Lua and the SDK you'll knock something out in no time - doncha think?

                   

                  _R

                  • 6. Re: Progamming export / import of XMP
                    NickCL Level 1

                    This is cool Rob. :-) I'll come back again. Cheers. Nick.

                    • 7. Re: Progamming export / import of XMP
                      john beardsworth Adobe Community Professional & MVP

                      Nick

                       

                      What is wrong with taking your Lightroom catalogue on the road? If space is the problem, just don't bother taking the previews folder. When you get back, File > Import from Catalog and you're done without all the alphabet soup.

                       

                      John

                      • 8. Re: Progamming export / import of XMP
                        NickCL Level 1

                        Hi John,

                         

                        I thought about that before but all I want is to add title / comments / keywords to my photos in my spare time at work, not using some fancy photo editing app that people can tell what you're doing at once -- you know what I mean. I could install Lr on my laptop so I can edit XMP when I use public transport, but then the machine won't have the enough power to run it anyway so, something lighter would best fit on me.

                         

                        The idea was to organize the metadata on road / work, so I can have more time to spend on development at home.

                         

                        Thanks.

                         

                        Nick

                         

                        Message was edited by: NickCL

                        • 9. Re: Progamming export / import of XMP
                          Henrik Eidem Kurka Level 1

                          And now with iPads it would be even more interesting to be able to edit metadata when out and about and then add the metadata back to LR later :-)