"Lost" Python macros

Hi,

I have a problem running an old Python macro that I've written for Calc. It is a plain .py file, stored under ~/.libreoffice/3/user/Scripts/python. I used to be able to run it via the Tools - Macros - Run Macro... menu command but now when I try, none of my macros are listed.

It's been at least 6 months since I ran it last and I must have upgraded the system a few times since then. Have there been changes in this area?

According to the About dialog, I have LibreOffice 3.5.3.2 Build ID: 350m1(Build:2) as provided with Ubuntu 12.04.

/ug

Am 01.07.2012 11:08, Ulf Göransson wrote:

Hi,

I have a problem running an old Python macro that I've written for Calc.
It is a plain .py file, stored under
~/.libreoffice/3/user/Scripts/python. I used to be able to run it via
the Tools - Macros - Run Macro... menu command but now when I try, none
of my macros are listed.

It's been at least 6 months since I ran it last and I must have upgraded
the system a few times since then. Have there been changes in this area?

According to the About dialog, I have LibreOffice 3.5.3.2 Build ID:
350m1(Build:2) as provided with Ubuntu 12.04.

/ug

Do you see any macros under Tools>Macros>Organize>Python?
Can you run the Hello World macro (under "LibreOffice Macros") against a new Writer document?

Yes and no. I see three example macros under "LibreOffice Macros" but none of my own.

And the hello world macro runs just fine.

/ug

Hi Ulf,

Yes and no. I see three example macros under "LibreOffice Macros" but
none of my own.

I take it that your own python scripts are still in the Script directory ? Just wondering whether an update hasn't overwritten the directory completely, and wiped them out.

Alex

Yes, they are still where they've always been. And I copied the file /usr/lib/libreoffice/share/Scripts/python/HelloWorld.py to the same location, just in case there had become something wrong with my files but that doesn't show up either.

However, when I did the opposite and put my script under /usr/lib/..., it worked alright. So I guess it is only my local directory that isn't working for some reason. Has the default directory name changed? Can it be edited somewhere?

/ug

Hi Ulf,

/usr/lib/libreoffice/share/Scripts/python/HelloWorld.py to the same
location, just in case there had become something wrong with my files
but that doesn't show up either.

However, when I did the opposite and put my script under /usr/lib/...,
it worked alright. So I guess it is only my local directory that isn't
working for some reason. Has the default directory name changed? Can it
be edited somewhere?

So looks like something got screwed up in the migration of your user configuration. Would be a good idea to report this as a bug, far too many user configuration migration failures go unnoticed by the devs. The more people report them, even if it turns out to be duplicate of one already registered, the more chance there is that attention will be given to the migration process.

I seem to recall however, that this was indeed one of the side effects of the migration from 3.4.x to 3.5.x.

Alex

For 3.5.4 running Ubuntu 10.4 . . .

In the Options / LibreOffice / Paths

Most of the paths used by LibreOffice are
/home/"username"/.config/libreoffice/3/user/. . . . . . . .

AutoCorrect, AutoText, Backups, Gallery, and Graphics all use that path.

So, would it be correct to assume that LO might want to have the Python Macros to be in that path as well?

In my system there is a "/3/user/Scripts" folder there but it is empty since I have not created any scripts.

Yes, that's it. I solved it myself a few moments ago but hadn't quite prepared a reply yet...

I found this page, that points out that the user profile has indeed moved in 3.5.x: http://wiki.documentfoundation.org/Documentation/UserProfile

The old one was in ~/.libreoffice/3 and now I see that there is actually an empty file there called MIGRATED.

Tools - Options - LibreOffice - Paths pointed me to the new location, ~/.config/libreoffice/3, which had an empty Scripts folder. When I moved my old python folder into that, everything started working.

The comments on this bug report
https://www.libreoffice.org/bugzilla/show_bug.cgi?id=46052
suggest to me that LibreOffice does no migration at all, could that be true? In that case, who did it? Ubuntu?

Anyway, thanks for all the clues!

/ug

Even though I "saw" the install seem to state that it was saving/copying the profile, for my 3.4.6 to 3.5.4, it did not and all my extension were missing. So it is not just Python Scripts that got lost in the upgrading, almost everything did.

This is surely a bug and would annoy a few of our users, and realy annoy our business users.

Am 01.07.2012 11:33, Ulf Göransson wrote:

Yes and no. I see three example macros under "LibreOffice Macros" but
none of my own.

And the hello world macro runs just fine.

/ug

You upgraded from 3.4 to 3.5 and some devel moron changed the location of the user profile from ~/.libreoffice/ to ~/.config/libreoffice.
You get a hint about the actual location in Tools>Options>Paths