UbuntuThis forum is for the discussion of Ubuntu Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Is there not a way to trigger a macro upon an event, similar to the "autoopen" macro of MS Word?
I've converted from Word to Writer, but am not yet expert with the details of Writer's macro languages and triggering technology -- I'd like to know also, but in my own case I want to go to a defined bookmark rather than to end of file. Can some Writer expert jump in and help both of us?
Here's what I came up with as the script, and when I attached it to the "Document Open" event it works automagically. Now to see if I can record navigation to a bookmark and get what I want from it. Hope this helps for you.
BTW, to get to this screen in Writer 5.1, use Tools>macros>edit....
Use Tools>Customize>Events to get the list of events. From that dialog click the Help button and it will give you step-by-step instructions on getting the correct macro library, which will be "My Macros" rather than the one listed for the specific open document, if you want the assignment to apply to all files. That's the only point where the help screen skips over any detail.
Now all I have to do is replace the assignment here, once I find the correct command to go to a bookmark.
BTW, I mis-spoke -- the event name is "Open Document" rather than "Document Open" <grin>.
Strange! Before I posted the screen shot, I tested to make certain it would work. I'm using the latest version of LibreOffice and that might make a difference. Does the macro work if you already have the file open but NOT at "end of file" and run it via Tools>Macros>Run?
I may have found a bug -- while the only details I could find about the "Open Document" event indicated that it happens when the document is fully open, I couldn't get it to work again here either.
I did find another event that DOES work, but I've found that in some cases it fires AFTER I am working in a file. It's worth a try, anyway. The attached screen shot shows the Tools>Customize screen after I select the "Events" tab, highlight the "View Created" event, then click the "Macro" button which lets me select the macro to be fired by that event. The red rectangle shows the event and attached macro on my test system. Your macro name may be different, however.
And along the way I DID discover how to do my "go to bookmark" at opening time, using the "View Created" event and learning the difference between "TextCursor" and "ViewCursor" in the rather unusual LibreOffice macro language! I included a pair of message boxes in my "GoBookmark" version to warn me if the event fires when I am working.
Let me know how this attempt works for you.
EDIT: After my original post of this message, I found more details at http://ooo-forums.apache.org/en/foru...hp?f=7&t=68077 which may be helpful. The very last post in that thread applies to this situation also, and the discussion of a Java error message is also helpful.
Last edited by JimKyle; 09-26-2016 at 01:01 PM.
Reason: To add link to thread elsewhere.
It won't, until you click the Macro button. I may also have told you wrong about putting it in the "My Macros" library although mine works from there. The link that I added to my previous message, possibly after you read it, has lots of good information about associating macros to events, even though the original problem being solved there has little to do otherwise with your problem or mine.
When you click the Macro button, another dialog pops up, and you need to select the specific macro you want to exeecute -- which cannot be stored in a document-specific library. The "My Macro" library is, I've concluded, your personal user-specific set of macro modules and macros, while the "LibreOffice" library is global and applies to all users. I'm wondering now, but haven't yet tested, whether the "Open Document" event might fire only from the LibreOffice global library.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.