How to deploy and invoke JavaScript in an extension`?

Discussions about using 3rd party extension with
Post Reply
Posts: 3
Joined: Tue Jan 20, 2009 7:21 pm

How to deploy and invoke JavaScript in an extension`?

Post by LuggeB »

Hi everybody,

first of all sorry for the cross post. But perhaps my question is more appropriate for the Extension forum.

Perhaps you can help me out. I created a BASIC Macro and a JavaScript Macro, both working fine and interacting with each other in my development environment.

The BASIC script invokes the JavaScript by

Code: Select all

oMasterScriptProviderFactory = createUnoService("")
oMasterScriptProvider = oMasterScriptProviderFactory.createScriptProvider("")
oTranslate = oMasterScriptProvider.getScript("")
So I created a extension using the Extension Compiler and it worked fine. But it doesn't seem to deploy the JavaScript though it's contained in the myExtension.oxt.

The parcel-descriptor of the JavaScript is

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<parcel language="JavaScript" xmlns:parcel="scripting.dtd">
    <script language="JavaScript">
        <locale lang="en">
            <displayname value="gtpt.js"/>
        <logicalname value="gtpt.js"/>
        <functionname value="gtpt.js"/>
The manifest.xml of the Extension contains

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE manifest:manifest PUBLIC "-// Manifest 1.0//EN" "Manifest.dtd">
<manifest:manifest xmlns:manifest="">
   <manifest:file-entry manifest:media-type="application/" manifest:full-path="Tooltips/tip-en.txt" />
   <manifest:file-entry manifest:media-type="application/" manifest:full-path="help" />
   <manifest:file-entry manifest:media-type="application/" manifest:full-path="Basic/GTPT/" />
   <manifest:file-entry manifest:media-type="application/" manifest:full-path="JavaScript/" />
   <manifest:file-entry manifest:media-type="application/" manifest:full-path="AddonUI.xcu" />
After installing the extension I get a librabry named GTPT in "My Macros" but I cannot find the Javascript.
What is wrong? Is there a way to deploy the JavaScript in My Macros of Java Script Macros in the respective Macro Organizer.
How do I invoke the Javascript correctly?

Thanks a lot in advance.
Best regards,
Posts: 885
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: How to deploy and invoke JavaScript in an extension`?

Post by hanya »

Here is an example to install the macro created by the JavaScript and the Basic.
Change the file extension to zip.
(3.48 KiB) Downloaded 344 times
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
Post Reply