Date: prev next · Thread: first prev next last
2016 Archives by date, by thread · List index


Hi,

i think, the Scripting Framework needs a 32bit Java JRE installed.
For example, if i remove  "C:\Program Files (x86)\LibreOffice 
5.1\program\classes\ScriptFramework.jar"
the macro will fail too.

Oliver

Am 14.04.2016 um 19:28 schrieb SOS:
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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice




Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.