Page 1 of 1

[Solved] Install macro in My Macros along with an extension

PostPosted: Tue Feb 12, 2013 2:13 am
by Scrumdidlyumptious
a

Re: Install a macro in 'My Macros' along with an extension?

PostPosted: Tue Feb 12, 2013 10:28 am
by B Marcelly
Yes that is possible.
See Toolbars page of the Developer's Guide. It's rather complex, for simplicity you may use an Extension Packager.
Note that toolbar xml files syntax will change in Apache OpenOffice 4.0 and Extension Packagers are not yet compatible.

Re: Install a macro in 'My Macros' along with an extension?

PostPosted: Tue Feb 12, 2013 12:29 pm
by Villeroy
As far as I know, an extension can install Basic libraries. It can not add modules to an already existing library.
Userdefined sheet cell functions such as =MYFUNC(A1:B13;1;C5) need to be saved within library "Standard" in order to be found. The special library named "Standard" always exists even if it is empty. So I believe that you can not install sheet cell functions by extension. An extension package can install your GUI driven macros to any user-defined library (not "Standard") with some unique library name.

Re: Install a macro in 'My Macros' along with an extension?

PostPosted: Tue Feb 12, 2013 4:26 pm
by B Marcelly
Villeroy, you are right, but...
Scrumdidlyumptious wrote:I have an extension that adds user defined functions to Calc

From what he said I inferred that its extension exists and works for him, whatever it contains. But maybe he uses the term extension incorrectly. Let us wait.

a

PostPosted: Wed Feb 13, 2013 4:25 am
by Scrumdidlyumptious
a

Re: Install a macro in 'My Macros' along with an extension?

PostPosted: Wed Feb 13, 2013 10:13 am
by Villeroy
Thank you for this important clarification. The vast majority of user defined cell functions are written as simple Basic functions without package, callable from Basic's "Standard" library.

Yes, macros can be distributed through packages too. The only precondition is that the library name must not exist in the global name space. Both "My Macros" and "OpenOffice Macros" are two sections of the same global name space so you can not have library "My Macros"."Tools" since a the office installation comes with a "OpenOffice Macros"."Tools".

For Basic macros there is ...
Tools>Macros>Organize>Basic... button [Organizer...], tab [Libraries]
... where the export button lets you export selected global libraries and document libraries into extension packages. The resulting package should be mergable with your own package. I don't know about any tool to merge extension packages but it merging a Basic package into your own one should be not too hard. Alternatively you may distribute 2 packages.

Re: Install a macro in 'My Macros' along with an extension?

PostPosted: Wed Feb 13, 2013 12:26 pm
by Scrumdidlyumptious
Thank you very much. Exporting allowed me to get the manifest details and an example of how to package it so I could just add the file-entry to my existing package's manifest. The problem was that I didn't know the 'manifest:media-type' for a Basic library but I was searching for the wrong answers on Google. Just for future reference a list of media-types is in the documentation which is probably where I should have checked first: http://wiki.openoffice.org/wiki/Documen ... ile_Format