Pass json object from JSX file to c++ plugin and return an array of json object from c++ plugin
Hi All,
I am looking for a solution in which I can pass json object as an argument to a scriptable method
I went through the scriptable plugin architecture and created a scriptable resource and added a method on document object as follows
resource VersionedScriptElementInfo(1)
{
//Contexts
{
kCS2ScriptVersion, kCoreScriptManagerBoss, kWildFS, k_Wild,
}
{
Method
{
kTestApplyScriptElement,
e_TestApplyTag,
"apply tag",
"Apply the tag",
Int32Type, // status code
"Status: 0 if ok, non-zero if error"
{
p_TagInfo, "tag info", "tag info ...", RecordType(kAnyObjectScriptElement), kRequired,
}
}
// Connects this plug-in's text attribute to scripting and INX round trip.
Provider
{
kTestProviderBoss,
{
Object{ kDocumentObjectScriptElement },
Method{ kTestApplyScriptElement }
}
}
}
my provider file look like as follows
=====
;
=====
Now what code I should write in TestProvider::ApplyTag to get the key value pair of json object which I send from jsx file while calling this function.
code in jsx file is look like as follows
function test() {
var info = {};
info["name"] = "abc";
info["id"] = "1";
info["address"] = "abc xyz";
info["code"] = "w12";
app.activeDocument.applyTag(info)
}
Please help me to get solve it.
Regards,
Alam
