Can Java Scripts no longer been called from basic macro ?

SOS sos at pmg.be
Thu Apr 14 17:28:44 UTC 2016


Oliver,
sorry but still the same error
An exception occurred
Type: com.sun.star.script.provider.ScriptFrameworkErrorException
Message: unsatisfied query for interface of type 
com.sun.star.script.provider.XScriptProvider!.

- Windows 8
- het scripts are on the machine  "C:\Program Files (x86)\LibreOffice 
4\share\Scripts\javascript\HelloWorld\helloworld.js"

but in de UI i can also not sea the Java libraries  maybe i must 
enabling something in the options to handle java ?

Greetz




On 14/04/2016 19:03, Oliver Brinzing wrote:
> Hi,
>
> this will work in LO 4 and LO 5:
>
> OPTION EXPLICIT
>
> Sub oJavaScriptMacro
>     Dim oMSPF as Object
>     Dim oSP as Object
>     Dim oScript as Object
>     oMSPF = 
> GetDefaultContext.getValueByName("/singletons/com.sun.star.script.provider.theMasterScriptProviderFactory")
>     oSP = oMSPF.createScriptProvider("")
>     ' JavaScript Macro
>     oScript = 
> oSP.getScript("vnd.sun.star.script:HelloWorld.helloworld.js?language=JavaScript&location=share")
>     oScript.invoke(Array(), Array(), Array())
> End Sub
>
> Regards
> Oliver
>
> _______________________________________________
> LibreOffice mailing list
> LibreOffice at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/libreoffice



More information about the LibreOffice mailing list