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?
Thank you for your previous response, which resolved my initial issue. However, I am now facing a new challenge. When a user clicks on a hyperlink, how can I retrieve the tooltip text associated with it? We embed parameters within the tooltip, so if capturing it on click isn’t possible, selecting the text and using a right-click menu would also be acceptable. Unfortunately, the API documentation only shows methods like onRange.GetText() for retrieving text. How can I access the ApiHyperlink object directly?
We use ApiHyperlink because we need to display custom presentation text when the user hovers over a hyperlink, and we want to allow users to trigger modifications to this text directly within the plugin.
Thank you for your reply. The previous issue has been resolved, but I am now encountering a new problem.How can the plugin obtain the ApiHyperlink object via a user click or selection so that it can extract the Screen Tip text and allow the user to modify it?
No, I need users to retrieve the Tip text of a hyperlink after clicking on it; if that isn’t possible, then obtaining it via the right-click menu is acceptable.