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

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
DWFII
Posts: 48
Joined: Sat Jan 09, 2010 3:30 am

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

Post 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?
Last edited by DWFII on Fri Feb 26, 2010 3:55 am, edited 1 time in total.
Open Office 3.3 on Win7 Pro x64
FJCC
Moderator
Posts: 9248
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Where are macros stored...??

Post 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.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
DWFII
Posts: 48
Joined: Sat Jan 09, 2010 3:30 am

Re: Where are macros stored...??

Post 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.
Open Office 3.3 on Win7 Pro x64
vasa1
Volunteer
Posts: 261
Joined: Sat Dec 26, 2009 1:20 pm
Location: Bombay

Re: Where are macros stored...??

Post 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!
LibreOffice 5.2.1.2 on Lubuntu 16.04 (Openbox)
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Where are macros stored...??

Post 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.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
B Marcelly
Volunteer
Posts: 1160
Joined: Mon Oct 08, 2007 1:26 am
Location: France, Paris area

Re: Where are macros stored...??

Post 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.
Bernard

OpenOffice.org 1.1.5 / Apache OpenOffice 4.1.1 / LibreOffice 5.0.5
MS-Windows 7 Home SP1
DWFII
Posts: 48
Joined: Sat Jan 09, 2010 3:30 am

Re: Where are macros stored...??

Post 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.
Open Office 3.3 on Win7 Pro x64
Post Reply