John - What you're asking for has been on my to-do list for a long time. I had the exact same problem - needing to read the stdout of an external app - and the code I expected to write was going to do just what you describe with writing a temp file then reading it. I simply haven't gotten around to coding it up yet. I would definitely support this as feature request.
Thanks Dave - that's good to confirm the approach. It's such a pain to be using Exiftool to do what LR's perfectly-good XMP engine could be made to do!
First of all, I agree that we need more open metadata read/write capabilities in Lightroom SDK. The current artificial limit is frustrating and if they didn't have the limit in place you wouldn't need to deal with the second issue.
re Executing a command and returning the output. This would be a good feature to be added to the Lightroom SDK. I'm envisaging something like the popen function that has been available in C since forever. The LightroomTether plugin (source is unencrypted) includes a Mac specific example of how popen has been emulated using a FIFO file. Might be possible to do this on Windows as well but would probably require the user to have their drive formatted using NTFS (to use NTFS streams) so would only work for some Windows users. In the short term we probably need to use wrapper functions to hide the detail of creating, blocking for program return code, reading temporary files then returning the STDIO and STDERR results, but I'd prefer this to be available in the SDK.
Hmmm, I responded via email 8 hours ago yet it hasn't shown up. This response might be duplicated if there's just a big latency:
John - Yes, it's frustrating knowing how much powerful functionality is sitting there but not accessible to us. I hope the SDK opens up much more in upcoming versions.
Let me know when/if you proceed with this particular idea. I have a project I'm going to need this for in about a month or so and it'd be nice to not reinvent the wheel. If you won't need it until after that, I'll get it going and then we can compare notes when you're ready. Plus, I'm on Windows and would need a Mac user to verify things are working - I assume you'll need the reverse (?).
John, another vote for better XMP support in the LR SDK, along with better access to the keywords...at least be able to set them!
In the meantime...earlier this year I started looking at using option -X to format the Exiftool output as XML and piping it to a file, then reading the file and parsing it with LrXml. I didn't get much beyond testing the theory and pushed the feature further down my todo list...but I am getting close to needing the functionality again.
Interested to see if anyone has any more ideas or has anyone already coded it?
+1 to better XMP support in SDK.
I've done something similar, but as i don't need the Exif info in the program, i have no problem reading it (open notepad and it's done).
I guess -X parameter and XML parsing is the best solution and doesn't seem too difficult :-)