Page 1 of 1

[Solved] Where are macros stored...??

Posted: Sat Feb 20, 2010 5:12 pm
by DWFII
I'm on a WinXP computer and have some simple macros I have created which I'd like to share with my office computer. Where can I find them?

Re: Where are macros stored...??

Posted: Sat Feb 20, 2010 5:47 pm
by FJCC
If they are written in Basic and they are stored in the Standard library of MyMacros, then they are in a location like
C:\Documents and Settings\username\Application Data\OpenOffice.org\3\user\basic\Standard

For simple macros it might be easier to just copy the code out of the Basic IDE into a Writer document and paste from there into the Basic IDE of your office computer.

Re: Where are macros stored...??

Posted: Tue Feb 23, 2010 3:58 pm
by DWFII
Thank you for the response...

Along the same lines, I don't quite understand how macros are "organized."When I open the "organize macros" window I have to drill down through about three levels to get to the macros I've created or use. Being the cautious sort, I have not tried to change this hierarchy but I am wondering if I can just create a top-level "folder" and move all my macros into it rather than "Open Office Basic">"My Macros">"Standard">"Module 1>."

When I want to run a macro I have to click three times before I can even select the macro I want.

Re: Where are macros stored...??

Posted: Tue Feb 23, 2010 6:22 pm
by vasa1
DWFII wrote:Thank you for the response...

Along the same lines, I don't quite understand how macros are "organized."When I open the "organize macros" window I have to drill down through about three levels to get to the macros I've created or use. Being the cautious sort, I have not tried to change this hierarchy but I am wondering if I can just create a top-level "folder" and move all my macros into it rather than "Open Office Basic">"My Macros">"Standard">"Module 1>."

When I want to run a macro I have to click three times before I can even select the macro I want.
You can assign keystrokes (starting with Alt or Ctrl, for example) to the macros. Then you don't have to bother drilling down. You do have to remember the keystrokes though!

Re: Where are macros stored...??

Posted: Tue Feb 23, 2010 7:15 pm
by Villeroy
There is a single collection of Baisc libraries stored in two different locations:
<install_directory>/basis3.1/share/basic/ = [OpenOffice.org Macros, read-only, installed with the program, "Depot", "Euro", Gimmicks", "Tools",...]
<user_profile>/basic/ = [My Macros, read-write, starts with empty lib "Standard"]

"Single collection" means that you can not add library "Tools" to "My Macros" because there is one already in the installation folder.

Every file in that hierarchy is plain XML, accessible with your text editor (except for encrypted modules).
Both folders have one file script.xlc where the libraries are registered.
A typical entry in a script.xlc registering a library "FormWizard":

Code: Select all

<library:library library:name="FormWizard" xlink:href="$(INST)/share/basic/FormWizard/script.xlb/" xlink:type="simple" library:link="true" library:readonly="false"/>
Both folders have one file dialog.xlc where the libraries with dialogs are registered.
A typical entry in a dialog.xlc:

Code: Select all

<library:library library:name="FormWizard" xlink:href="$(INST)/share/basic/FormWizard/dialog.xlb/" xlink:type="simple" library:link="true" library:readonly="false"/>
The entries in the .xlc files point to some folder and a file script.xlb and dialog.xlb where each module (or dialog respectively) is registered.

A typical entry in script.xlb registering a module "Language"

Code: Select all

 <library:element library:name="Language"/>
A typical entry in dialog.xlb registering a dialog "DlgFormDB"

Code: Select all

  <library:element library:name="DlgFormDB"/>
Modules are saved as .xba files, dialogs are stored with suffix .xdl

You find the exact same hierarchy of folders, xlc, xlb, xba and xdl files within office documents.

Re: Where are macros stored...??

Posted: Wed Feb 24, 2010 9:50 am
by B Marcelly
Hi,
DWFII wrote:When I want to run a macro I have to click three times before I can even select the macro I want.
If you mean :
Menu Tools > Macros > Organize Macros... > OpenOffice.org Basic
you can customize the Standard toolbar to add a button that directly opens the dialog OpenOffice.org Basic Macros:
Customizing toolbar
Customizing toolbar
You will have to do this once for each OpenOffice.org application you need : Writer, Calc etc.
Alternatively you could create a keyboard shortcut to call the dialog.

Re: Where are macros stored...??

Posted: Fri Feb 26, 2010 3:54 am
by DWFII
FJCC wrote:If they are written in Basic and they are stored in the Standard library of MyMacros, then they are in a location like
C:\Documents and Settings\username\Application Data\OpenOffice.org\3\user\basic\Standard

For simple macros it might be easier to just copy the code out of the Basic IDE into a Writer document and paste from there into the Basic IDE of your office computer.
Thanks. I took your advice. Worked like a charm.