In the developer trial version, the automation API doesn't work

462d432e8b12cb7598e5502a5199453
In a component of my Vue 2.x project, I followed the example in the official documentation to create a listener using the automation API, but it didn’t work.





const docEditor = new DocsAPI.DocEditor(“placeholder”, initConfig);
const connector = docEditor.createConnector();
connector.attachEvent(“onChangeContentControl”, (obj) => {
console.log([EVENT] onChangeContentControl: ${JSON.stringify(obj)});
});
connector.executeMethod(“GetSelectedText”, , (selectedText) => {
console.log(“Selected text:”, selectedText);
});
Is it because there is something wrong with my usage method?

Hello @peng,
Could you please clarify in more detail the scenario you want to implement and what exactly is not working in this function?

If you don’t mind, I will join this thread as well.
Please try to use this sample as a guideline:

connector.attachEvent("onChangeContentControl", (obj) => {
  console.log("[EVENT] onChangeContentControl:", JSON.stringify(obj));
});

connector.executeMethod("GetSelectedText", [], (selectedText) => {
  console.log("Selected text:", selectedText);
});