OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Name and location of macro file? (OS X 10.6.8)

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
dudleybrooks
General User
General User


Joined: 09 May 2012
Posts: 7
Location: San Francisco

PostPosted: Wed May 09, 2012 2:46 pm    Post subject: Name and location of macro file? (OS X 10.6.8) Reply with quote

I think I may have accidentally deleted my macros, perhaps while removing Microsoft Office (possibly I didn't notice that the file name had "NEOoffice", and just saw "office"). At any rate, the macros I created no longer show up. I can probably find them using OS X's Time Machine backup -- if I know which files to look for and where they are stored. Thanks.
Back to top
View user's profile Send private message Visit poster's website AIM Address
lknoll
General User
General User


Joined: 19 Oct 2011
Posts: 32
Location: Harrisburg, Pa

PostPosted: Thu May 10, 2012 6:44 am    Post subject: Reply with quote

this is where my macros are stored locally:

C:\Users\*UserName*\AppData\Roaming\OpenOffice.org\3\user\basic\

AppData is a hidden directory.
Basic folder holds all macro code.
Back to top
View user's profile Send private message
dudleybrooks
General User
General User


Joined: 09 May 2012
Posts: 7
Location: San Francisco

PostPosted: Tue May 22, 2012 1:34 pm    Post subject: Name of macro files? Reply with quote

Thanks for the reply. Sorry I haven't been able to get back to this forum before now.

What is/are the name(s) of the macro file(s)? I have to search through Time Machine, and it's far, far easier to just do a search on the file name than to look in that directory for each generation of Time Machine until I see a file that looks like a macro file.

Thanks.
Back to top
View user's profile Send private message Visit poster's website AIM Address
dudleybrooks
General User
General User


Joined: 09 May 2012
Posts: 7
Location: San Francisco

PostPosted: Wed May 23, 2012 10:45 am    Post subject: Help! Can't find lost macros. Reply with quote

I'm lost here. I've gone through my entire Time Machine, and can't find any save in which the files are different from the current ones (except date, of course). I also don't find any file which has a name like even the built-in macros, which are still there, let alone the ones I created, which I have lost.

The files I see under .../basic/ are

dialog.xlc
script.xlc
Standard/
dialog.xlb
Module1.xba
script.xlb

Are the macros contained in one of those files? If so, which one? And is there any way to know which one (in Time Machine) contains the macros I lost, other than restoring each one in turn (back through the entire Time Machine history) and seeing which one works? They all have the same size, and I don't know what the date was when the macros were lost.
Back to top
View user's profile Send private message Visit poster's website AIM Address
lknoll
General User
General User


Joined: 19 Oct 2011
Posts: 32
Location: Harrisburg, Pa

PostPosted: Thu May 24, 2012 5:23 am    Post subject: Reply with quote

.xba files contain the actual macro code.

i am not sure how you will be able to tell which version contains the code you lost. you can open these files in notepad (or any other simple text editor) and view the contents, if there is an easy way to identify the lost code.
Back to top
View user's profile Send private message
dudleybrooks
General User
General User


Joined: 09 May 2012
Posts: 7
Location: San Francisco

PostPosted: Thu May 24, 2012 7:55 am    Post subject: Code *is* in current .xba, but macros *still* don't show up! Reply with quote

(Something is weird with this forum: yesterday there was a reply by another user, also recommending looking at the .xba file(s) in a text editor, and today his reply no longer shows up. And I posted the reply below, and today it no longer shows up either. Why did his reply and my reply disappear???)

I looked at the Module1.xba file which is currently there (in .../basic/Standard/ on the HD) -- and it does have the code for my macro. But when I use Tools>Macros>Run Macro...>My Macros>Standard, the virtual "Standard" folder is empty. So what else can be the problem? Is there some other missing file which is necessary to enable macros? Or is there a problem in Module1.xba itself? The first lines of that file say

Sub Main
End Sub

followed by the (named) sub for my macro. Is this how it should be?

(In case it makes a difference: it was not a macro which I programmed in Basic; it was one where I merely recorded my keystrokes. So I don't know what the "original" Basic looked like, to be able to recognize if there is any corruption.)
Back to top
View user's profile Send private message Visit poster's website AIM Address
lknoll
General User
General User


Joined: 19 Oct 2011
Posts: 32
Location: Harrisburg, Pa

PostPosted: Thu May 24, 2012 8:06 am    Post subject: Reply with quote

check /Basic/Standard/Script.xlb it should contain a line referencing the code file:

Code:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="Standard" library:readonly="false" library:passwordprotected="false">
     <library:element library:name="Module1"/>
</library:library>


Also check
/Basic/script.xlc is should (and probably does) reference the Standard library.

Code:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE library:libraries PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "libraries.dtd">
<library:libraries xmlns:library="http://openoffice.org/2000/library" xmlns:xlink="http://www.w3.org/1999/xlink">
    <library:library library:name="Standard" xlink:href="$(USER)/basic/Standard/script.xlb/" xlink:type="simple" library:link="false"/>
</library:libraries>
Back to top
View user's profile Send private message
dudleybrooks
General User
General User


Joined: 09 May 2012
Posts: 7
Location: San Francisco

PostPosted: Thu May 24, 2012 9:13 am    Post subject: SOLVED Reply with quote

Thanks! The .xlc file was correct but the .xlb file was missing the last two lines. I tried adding them in a text editor but when I loaded NeoOffice I got a "General input/output error" message about that file. So I found a version of the file from Time Machine which was old enough to be correct.

Thanks again!

For the future, where do you recommend that I should read about all this "under the hood" stuff like file locations, names, and content?

One particular question: *Should* I have been able to successfully modify the file in a text editor? I made sure I saved it as text, with the correct extension. Or do I need to use some built-in editor in NeoOffice?
Back to top
View user's profile Send private message Visit poster's website AIM Address
lknoll
General User
General User


Joined: 19 Oct 2011
Posts: 32
Location: Harrisburg, Pa

PostPosted: Tue May 29, 2012 5:16 am    Post subject: Reply with quote

you can modify those files in any editor and they should work. they are xml, so you have to make sure to follow those standards.

as for where to read about this stuff, i started with this book as a starting point http://www.pitonyak.org/book/. but for all of my issues now i use google and trial & error.
Back to top
View user's profile Send private message
dudleybrooks
General User
General User


Joined: 09 May 2012
Posts: 7
Location: San Francisco

PostPosted: Tue May 29, 2012 11:11 am    Post subject: Reply with quote

I don't know why my edit didn't work, but I'll worry about that in the future, if I ever have to edit again. Thanks for the reference to the book. And thanks also for the corroboration that one of my methods (google and trial and error) works. Of course, my most frequent method, successful in this case, is "ask online and get the answer from someone who has already done the hard work!" Thanks!
Back to top
View user's profile Send private message Visit poster's website AIM Address
dudleybrooks
General User
General User


Joined: 09 May 2012
Posts: 7
Location: San Francisco

PostPosted: Sun Jun 03, 2012 10:21 pm    Post subject: SPAM! Reply with quote

How do I report the above spam on this forum?
Back to top
View user's profile Send private message Visit poster's website AIM Address
RPG
Super User
Super User


Joined: 24 Apr 2008
Posts: 2697
Location: Apeldoorn, Netherland

PostPosted: Tue Jun 05, 2012 10:57 am    Post subject: Reply with quote

Hello

http://www.oooforum.org/forum/viewtopic.phtml?t=44374

Read post

Romke
_________________
OOo 3.4.5 on openSUSE 12.1
Use this forum : http://user.services.openoffice.org/en/forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group