xattr write delimiter
OM tags (com.apple.metadata:kMDItemOMUserTags) as well as user defined tags (com.apple.metadata:_kMDItemUserTags) are stored in an extended attribute and its value is a binary property list that contains a single array of strings.

Example with the tag user (xxd'd and converted to a xml with plutil):

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;array&gt;
    &lt;string&gt;user&lt;/string&gt;
&lt;/array&gt;
&lt;/plist&gt;


Simply using xattr -w com.apple.metadata:kMDItemOMUserTags tag1 file won't create a properly defined OMUser or (Apple) User tag.

I recommend to use an "add tag" Python script like this one.



kMDItemOMUserTags seems to be outdated (or at least "difficult" to use) in macOS and are sometimes/often replaced with the _kMDItemUserTags even in OpenMeta apps.