Message Boards Message Boards

8 Replies
2 Total Likes
View groups...
Share this post:


Posted 10 years ago

There is a MousePosition function that will return the current mouse position as an ordered pair. I'm looking for a ScrollPosition function that will return the current scroll position as an ordered pair. Does anyone know if there is one or a workaround? Thank you.


POSTED BY: Michael McCain
8 Replies

You're awesome! This will work. Thank you David!!!

POSTED BY: Michael McCain

Though I don't have a solution to "Exact", there is an approach to getting back to the same cell that you were at. This is to tag the cell with a unique CellTag and then search for that CellTag using NotebookFind. Once found, you can then do a SelectionMove to Before the Cell or After the Cell. (Also before doing such a move you generally should remove the cell tag just for good housekeeping.) I am fond of tagging... See

from some while ago.

POSTED BY: David Reiss

Thank you Kuba. Yep, I am aware of those tokens.

To clarify, I am moving around a notebook programmatically but then when I am done I would like to come back to where I started at same cell and the same scroll position. That way I don't have to search up and down the screen. I want it to come back to the exact same position as when I left so the screen is in the exact same position as when I left and my eyes don't have to move at all.

POSTED BY: Michael McCain
Posted 10 years ago

I can partially answer your second wish, you can scroll to some places :) with FrontEndTokens:

FrontEndTokenExecute[EvaluationNotebook[], "ScrollNotebookEnd"]

other that seems to be relevant:

{"ScrollLineDown", "ScrollLineUp", "ScrollNotebookEnd", 
"ScrollNotebookStart", "ScrollPageBottom", "ScrollPageDown", 
"ScrollPageFirst", "ScrollPageLast", "ScrollPageNext", 
"ScrollPagePrevious", "ScrollPageTop", "ScrollPageUp"}
POSTED BY: Kuba Podkalicki

Thank you David.

POSTED BY: Michael McCain

There does not seem to be a ScrollPosition option for Notebook. And hunting around in various other places there does not seem to be something that is equivalent. I wonder whether there is a means of using CurrentValue in someway to get at this. But, if not, then this is a very sensible suggestion to pass on to the developers because this is clearly a form of control of the notebook that should be in the system, and should be an option to Notebook.

POSTED BY: David Reiss

Hi Paul,

No. But thank you for your response. : ) I'll clarify...

If you have a notebook with lot of content open you will see a scroll bar on the far right and bottom. I'm looking for a function that will return the current value of of the scroll bars. I'd also like to be able to set the value of the scroll bars with a function call.

In a pane, there is a ScrollPosition option which allows you to set both scroll positions to an ordered pair like {500,600}. However, I don't see an option for the entire notebook.

POSTED BY: Michael McCain
Posted 10 years ago

Do you mean this?



POSTED BY: Paul Cleary
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract