How to make PageDown scrolls document without moving cursor down?

I translate the text below, deleting what has already been translated, and the cursor gradually reaches the bottom of the page. I need to scroll the page so that the cursor is at the top of the page, over a new piece of untranslated text. The PageDown button scrolls the page and moves the cursor, and I don’t need to move it. How to fix it? You probably need a macro, but what should have been written in it?

P.S. Basically I need PageDown works as a successive pressing PageDown and then PageUp

Try with menu Window - New Window.
imagen

EDIT:
Type in the upper window. The cursor always will be in the upper part of your screen.
Just an idea.

1 Like

I don’t understand how it helps.

In the Sidebar click on Navigator and up at the top there are two arrow icons, Previous page and Next page, they always take you to the top of the previous or the next page. The cursor stays where it was, can be tested by pressing left or right arrow which will take you back to cursor.
The commands are Previous Element and Next Element; these could be tied to a keyboard command like such as Alt+P and Alt+N through Tools > Customise if you wanted to

Cross posted to Reddit

If you cross post, please let us know that you have done so, otherwise it leads to several discussions and a waste of time because several identical answers may be posted by different users.

1 Like

I consider this gives more probability to find an answer, as probably different people read reddit and thematic site.

You was never asked to avoid cross-posting, only to inform people, so that they can look at the other resource to find if the answer they are going to provide had already been provided. Please consider reading the messages before replying. Thanks.

1 Like

Via ChatGPT I found solution.

Sub Scroll_Page_Down()
ThisComponent.getCurrentController().getViewCursor().GoDown(20, False)
ThisComponent.getCurrentController().getViewCursor().GoUp(20, False)
End Sub

This scrolls the cursor down and then up 20 lines (you can choose any other number), so that if the cursor was at the bottom of the page, it moves approximately to the middle. While I’d like the cursor to be at the top of the page rather than roughly in the middle, this is useful.

So Next Element command didn’t work?

I didn’t know about it. It works, but goes too much down.

Visible cursor has more methods than only GoDown or GoUp.

Sub jumpsWithVisibleCursor
	dim oDoc as object, oVCur as object
	oDoc=ThisComponent
	oVCur=oDoc.CurrentController.ViewCursor
	'msgbox oVCur.dbg_methods 'show methods of visible cursor
	oVCur.jumpToNextPage
	oVCur.jumpToEndOfPage
	oVCur.jumpToStartOfPage
End Sub

ChatGPT etc. is only mixture of the parts of facts and parts of nonsenses. Primarily it is based on dull computed mathematical probabilities in input data mixed with the pseudogenerators of random numbers. So the certainties with the AI’s outputs are:

1) it isn’t functional and it does an errors
2) it is somehow functional, but it does different behavior than you really need
3) when it seems it is functional, then there are mistakes and falsehoods, but you don’t know where :frowning:
4) and if you try to find the mistakes and falsehoods in it, probably you will feel the disgust and tiredness.

:slight_smile: