How to locate python macro for editing?

I am using Ubuntu 12.04 and LibreOffice 3.5.7.2.

A couple of years ago I created a python macro and a custom menu entry to run it. It still works but I am going to change the underlying sheet and will need to change the macro. The problem is I haven't done any work with macros since I wrote it and now I can't find it to edit.

If I look in Tools-->Macros-->Organize Macros-->Python I see:

MyMacros (It's not in here)
LibreOfficeMacros (It's not in here)
MySpreadsheet.ods (clicking or double clicking this does nothing)

It is not in /usr/lib/libreoffice/share/Scripts/Python

or

/.config/libreoffice/3/user/Scripts/python

I can't remember if it is possible to embed a python macro in a sheet or not. If it is how do I edit it?

The name of the macro in the menu is enterPmts. I have searched the file system for enterPmts.py and variations but have found nothing.

I'm feeling a little dumb right now so any help is appreciated.

Regards, Jim

Clearly there is a difference between "feeling dumb" and "being dumb" since it looks like you looked in the right places :slight_smile:

I know little to nothing about macros in Python, but, here are some random uninformed thoughts.

1. You want to know if the macro is embedded in a document. Well, how do you run the macro? Are you able to run this macro when no documents are loaded? If yes, then, that macro is NOT contained in a document.

2. Have you attempted something extreme like "find . | grep -i enterPmts

How do you know that the macro is named enterPmts.py anyway? If it really is named that, then you may need to simply search the entire file system. Sadly, I do not have version 3.x installed, so I cannot test.

I think that it is possible to store macros in a different location and import a link to them, so, it may not live where you expect. Depending on how you run them, however, (at least in basic) there is a script.xlc and script.clb file that references the libraries and macros (for basic). I expect that you might have something similar in the python directory. Do you have a python directory, or, only the basic directory (.config/libreoffice/3/user/python)? If you do, does that directory contain a file with a link to "stuff"?

Andrew,

Thanks for the kind words, but I don't think I deserve them. :slight_smile:

I had one of those 'ah hah' moments last night. Turns out this macro was older than I thought and was written when I was trying to learn LO's basic. So it was written in basic not python. Eventually at that time I decided instead of learning a new language I would figure out how to use one I already knew (python) in LibreOffice macros.

Sorry for the noise.

Regards, Jim

Hi :slight_smile:
The "noise" is welcome. This time it's been interesting to hear that
people really do use some of the other languages that can be used for
macros in LO and AOO.
Regards from
Tom :slight_smile: