Unexpected result with @Keywords

Started by PoeschelA, November 04, 2014, 03:48:30 PM

Previous topic - Next topic

PoeschelA

Hi, my script create a string like that: "Deutschland * Germany; Europa * Europe; Hamburg * Hamburg" and this is stored as keywords:

temp1 = Join (Cat, "; ") ' Return a string by concatenating all the values in the array with Sep in between each one
Set vals = data("XMP::Lightroom\hierarchicalSubject\HierarchicalSubject\0") ' Keywords
vals.Set temp1
data.Update vals

Works fine.

I expect to have this result:
@Keywords|Deutschland * Germany
@Keywords|Europa * Europe
@Keywords|Hamburg * Hamburg

The result is:
@Keywords|Deutschland * Germany; Europa * Europe; Hamburg * Hamburg

Preferences/Metadata: Keyword separator is set to ";"

Please, where is my mistake?

Ferdinand

IMatch ships with a sample script "Metadata" that has code that demonstrates how to write keywords.  I suggest you look at it and use that code.

I think that the keyword separator option in metadata preferences is for reading keywords, not writing them.  That is, if you have an IPTC field such as Supplemental Categories (for example) with the value "A;B;C" then this option will tell IMatch to parse this field into three separate keywords when you first ingest that file. 

But this option will have no effect on writing keywords.  The keywords field is what is known as a multi-value field, so that it is structured to store multiple values and does not use a separator character to separate those values.

PoeschelA

Thanks Ferdinand, you are right, I did an error during thinking.
I followed your hint "look at script Metadata" and found the solution.
Now everything works well :-)

Ferdinand

There is something else to consider.  In IMatch 5 you may not need a script to do what you want to do.  There's a very good chance that a metadata template will do the same thing.