LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 09-22-2016, 03:39 PM   #1
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Rep: Reputation: 169Reputation: 169
Open file at end of file


I have several files that I update on a regular basis. (Libre Writer)

Is there any way to have individual files open with the cursor at the end of file ?

I have been using Ctrl End.

I made a macro, but it takes more steps.
 
Old 09-23-2016, 01:33 AM   #2
HMW
Member
 
Registered: Aug 2013
Location: Sweden
Distribution: Debian, Arch, Red Hat, CentOS
Posts: 773
Blog Entries: 3

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
Edit: Nevermind!
 
Old 09-23-2016, 10:23 AM   #3
JimKyle
Member
 
Registered: Dec 2001
Location: Oklahoma City, OK, USA
Distribution: Xubuntu 16.04 LTS
Posts: 214
Blog Entries: 1

Rep: Reputation: 39
Trigger by event?

Quote:
Originally Posted by Fixit7 View Post
I made a macro, but it takes more steps.
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?
 
Old 09-23-2016, 11:12 AM   #4
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
Not that I am aware of.

I thought of a script, but don't know of a command to go to the end of file.
 
1 members found this post helpful.
Old 09-23-2016, 12:40 PM   #5
JimKyle
Member
 
Registered: Dec 2001
Location: Oklahoma City, OK, USA
Distribution: Xubuntu 16.04 LTS
Posts: 214
Blog Entries: 1

Rep: Reputation: 39
Smile

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....
Attached Thumbnails
Click image for larger version

Name:	eof_macro.jpg
Views:	15
Size:	63.1 KB
ID:	23085  
 
Old 09-23-2016, 01:52 PM   #6
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
Thanks.

How do I attach it to the Document Open event ?
 
Old 09-23-2016, 05:54 PM   #7
JimKyle
Member
 
Registered: Dec 2001
Location: Oklahoma City, OK, USA
Distribution: Xubuntu 16.04 LTS
Posts: 214
Blog Entries: 1

Rep: Reputation: 39
Quote:
Originally Posted by Fixit7 View Post
How do I attach it to the Document Open event ?
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>.

Last edited by JimKyle; 09-23-2016 at 05:55 PM.
 
Old 09-23-2016, 05:59 PM   #8
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
I did so, but it does not go to the EOF.
 
Old 09-23-2016, 06:25 PM   #9
JimKyle
Member
 
Registered: Dec 2001
Location: Oklahoma City, OK, USA
Distribution: Xubuntu 16.04 LTS
Posts: 214
Blog Entries: 1

Rep: Reputation: 39
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?
 
Old 09-24-2016, 06:03 PM   #10
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
Yes, the macro runs ok when run manually.
 
Old 09-26-2016, 12:37 PM   #11
JimKyle
Member
 
Registered: Dec 2001
Location: Oklahoma City, OK, USA
Distribution: Xubuntu 16.04 LTS
Posts: 214
Blog Entries: 1

Rep: Reputation: 39
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.
Attached Thumbnails
Click image for larger version

Name:	GoEnd.png
Views:	10
Size:	86.2 KB
ID:	23107  

Last edited by JimKyle; 09-26-2016 at 01:01 PM. Reason: To add link to thread elsewhere.
 
Old 09-26-2016, 01:50 PM   #12
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
Mine shows no macro next to view created.

Guess it's another bug.
 
Old 09-26-2016, 03:44 PM   #13
JimKyle
Member
 
Registered: Dec 2001
Location: Oklahoma City, OK, USA
Distribution: Xubuntu 16.04 LTS
Posts: 214
Blog Entries: 1

Rep: Reputation: 39
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.
 
Old 09-26-2016, 04:34 PM   #14
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
I stored macro under My Macros
Standard
Module 1
EOF

Still does not work.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Attach word from file to the end of other file recursively bash vnistelroot Programming 3 01-12-2012 09:51 AM
Running a Crafted bash script yelds 'Unexpected end of file' at the end of the file MCLover1337 Linux - General 5 10-15-2011 08:29 AM
How do you write a magic file test pattern to match the end of a file? arj Linux - Software 3 02-10-2011 05:38 PM
[SOLVED] Reading in a file in C, after file read null terminator at strings end gone josip76 Programming 2 05-14-2010 12:44 AM
how to delete last number/word of a file and incude file count at the end of the chennaiguy Linux - Newbie 2 02-18-2008 09:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 01:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration