On 15.03.2017 22:32, jan wrote: > Hello, > > I would like to execute the command "findAll" in a Javascript Macro. In > Basic, one can access thisComponent and access its findAll method (See [1]) > > However, the exposed Javascript API does not have thisComponent. I tried > > importClass(Packages.com.sun.star.frame.XDesktop) > var currentComp = XDesktop.getCurrentComponent() > > to get the current document (as described in [2]) but it failed > silently [3]. > > I also tried > > var desktop = XSCRIPTCONTEXT.getDesktop(); > var comp = desktop.getCurrentComponent(); > > …which gives me something, but that returned object does not have the > findAll-Method.
did you try the getDocument() method? http://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1script_1_1provider_1_1XScriptContext.html#a191c375534e4ecbb1309581035eca1c6 _______________________________________________ LibreOffice mailing list LibreOffice@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice