Copy link to clipboard
Copied
Hi,
I want to be able to set label on the document from my C++ plugin to that the same can be accessed from the jsx file.
IDocument* doc = GetIDocument(...)
UIDRef ownerUID = doc->GetDocWorkSpace();
Later during the persisting command execution I have code similar to the following
UIDRef owner = GetItemList()->GetRef(0);
InterfacePtr<IStringData> stringData(this, UseDefaultIID());
CHECK_BREAK(stringData);
PMString stringToWrite = stringData->Get();
InterfacePtr<I> persist(owner, UseDefaultIID());
CHECK_BREAK(persist);
persist->SetString(stringToWrite);
InterfacePtr<IScript> script(owner, UseDefaultIID());
if (script) {
PMString key = WrapperUtils<IUtilitiesWrapper>()->MakePMString(L"MyPluginLabelInfo");
script->SetTag(key, stringToWrite);
}
The 'script' pointer is coming as null while it works perfectly well for Page Items such as Text. What is the correct way to assign Tags (labels?) in the above persist implementation so that the information can be accesses from the jsx script?
Thanks,
kDocWorkspaceBoss has no IID_ISCRIPT. Use kDocBoss instead - ::GetUIDRef(doc).
Not sure why you run your own command, I'm using IScriptUtils::SetScriptingTag even though setup is a bit convoluted.
Copy link to clipboard
Copied
kDocWorkspaceBoss has no IID_ISCRIPT. Use kDocBoss instead - ::GetUIDRef(doc).
Not sure why you run your own command, I'm using IScriptUtils::SetScriptingTag even though setup is a bit convoluted.