I’ve been trying for a few days now different ways to save some data on a document level, so that when document is opened again, plugin would perform some actions if that data is set. No luck at all
I didn’t want to deal with XML, so I decided to first try json
property (saw @Jarda mentioning it here), but couldn’t make it work - either I got no error at all and property was not saved (but most likely descriptor was wrong), or I got error:
“Set” is not currently available
My final descriptor (also tried without _ref: "property"
):
{
_obj: "set",
_target: [
{_ref: "property", _property: property},
{_ref: "document", _id: docId}
],
to: {
_obj: "document",
[property]: data
},
_options: {dialogOptions: 'dontDisplay'}
}
When json
didn’t work, I tried exact same descriptor to try saving XMP metadata described here by @simonhenke (just changed a bit to save it on document level), but still no luck - no error this time and BP returns some object with a bunch of methods (which I’m not sure how to test what it is):
But even then when I get XMPMetadataAsUTF8
, my data that I tried to set is not there
Any advice? What am I doing wrong?