Dear Gyroscope,
The maximum scroll equals:
Code: Select all
the formattedHeight of fld x - the height of fld x - the margins of fld x - the textHeight of fld x
provided that the margins are an integer and the fixedLineHeight of the field is true. If the margins are no integer, you probably need to use item 4 of the margins. If the fixedLineHeight is not true, you need to find a way to figure out the height of the last line of your field. Also, the dontWrap of your field has to be set to true.
This is a nice way to do it:
Code: Select all
getProp maxScroll
if word 1 of the name of the target is "field" then
return (the formattedHeight of the target - the height of the target - the margins of the target - the textHeight of the target)
else return empty
end maxScroll
(untested, but should work)
Now, if you have this script at stack level or in a library, you can call this property using:
Code: Select all
put the maxScroll of fld x
set the vScroll of fld x to the maxScroll of fld x
The first line should return an integer, the second should set the scroll of a field to the largest possible value.
Best regards,
Mark