Copy link to clipboard
Copied
Long story, but I have lost about 5 years of extra information in custom fields, also backup. Luckely all this information is saved into a .json file with the images.
So for restoring them I was thinking to create a 'simple' lua script with a dialog for inserting this information back into lightroom.
My steps:
- Select the images where the information of the json file should be applied
- select the jason file
code not 100% correct but this should give an idea of this will work
read the json file and put each value into a variable
That approach should work. But I recommend doing very thorough error checking at each method call, since things can go wrong with LR scripts very quickly, in mysterious ways.
Also, you might out Friedl's JSON Encode/Decode module for reading the JSON files. It's very robust and used by many plugins (including mine):
https://regex.info/blog/lua/json
I just verified that the LR/Transporter plugin isn't able to import values into plugin custom metadata fields. It can export them but not import, unf
...Copy link to clipboard
Copied
That approach should work. But I recommend doing very thorough error checking at each method call, since things can go wrong with LR scripts very quickly, in mysterious ways.
Also, you might out Friedl's JSON Encode/Decode module for reading the JSON files. It's very robust and used by many plugins (including mine):
https://regex.info/blog/lua/json
I just verified that the LR/Transporter plugin isn't able to import values into plugin custom metadata fields. It can export them but not import, unfortunately. Otherwise, it might have been simpler to convert all the JSON files into a large CSV file to import.
Copy link to clipboard
Copied
Thank you John,
As always usesefull feedback.
It's not possible to create one large CSV file as each json file contains information for that specific directory.
The data is about the analog film used digitalisation and development.
Thank you for pointing out the Friedl"s JSON module, i'll look into it for future use. For now i'm going to use my own method to read a json file. A matter of getting my data back in as quickly as possible.
Copy link to clipboard
Copied
John,
Some feedback here, it works. I was able to put in about two years of data back in Lightroom, but yesterdag I found a problem.
Somewhere over the years I have change the naming of the fields of my json file, so I have two options rename everything in the plugin or do an adaption where I can use both values for feature use. But I don't know how to do this.
Short extract of my code with the use of Friedl's JSON lib
Thanks
Patrick
Copy link to clipboard
Copied
Hmm, I don't think I have enough information about the issue to provide useful feedback.
Copy link to clipboard
Copied
John,
I'm sorry, communication with email or through forums is sometimes difficult for me. As my wife sometimes tells me: I don't live in your head !
Meaning it stays in my head and I don't write this down, and I'm convinced that I have provided all the needed information.
As said above the naming of the fields in the json file have changed apparently over the years.
And I was looking for a way to make the plugin compatible with both naming conventions. From a previous conversation / help question you have provided a solution that contains an OR operator, and that did the trick.
So when I read the json file the value comes from (waarde["AFFilmStock"] or waarde["nlpFilmStock"]), and I do this for each field in the json file.
I'll hope this makes sense.
But I got it working, what is the most important.
Again thank you
Patrick
Find more inspiration, events, and resources on the new Adobe Community
Explore Now