This is very strange, at least to me. I can't get it.
This is the output under "Answer" in Apple Script Editor of your "PageDown" script:
tell application "System Events"
set frontmost of process "Numbers" to true
exists scroll bar 1 of scroll area 1 of splitter group 1 of splitter group 1 of window 1 of process "Numbers"
--> false
end tell
This is the output of your "End "script:
tell application "System Events"
exists scroll bar 1 of scroll area 1 of splitter group 1 of splitter group 1 of window 1 of process "Numbers"
--> true
set value of scroll bar 1 of scroll area 1 of splitter group 1 of splitter group 1 of window 1 of process "Numbers" to 1.0
end tell
If I add "Tell application 'Numbers' to activate" to your "End" script the output is this:
tell application "Numbers"
activate
end tell
tell application "System Events"
exists scroll bar 1 of scroll area 1 of splitter group 1 of splitter group 1 of window 1 of process "Numbers"
--> false
end tell
Your "End" script works when Numbers isn't in front, but when I run it with Numbers in front it doesn't work. I don't get why scroll bar 1 is false as soon as Numbers is frontmost. This must be the explanation why your "home" and "End" script only works when Numbers isn't in front.
All your scripts works, even when Numbers is in front, if I add "activate" under any of the lines "tell process 'Numbers", "tell window 1" etc. When I do so to your "PageDown" I get this output:
tell application "System Events"
set frontmost of process "Numbers" to true
activate
exists scroll bar 1 of scroll area 1 of splitter group 1 of splitter group 1 of window 1 of process "Numbers"
--> true
get position of scroll area 1 of splitter group 1 of splitter group 1 of window 1 of process "Numbers"
--> {387, 115}
get size of scroll area 1 of splitter group 1 of splitter group 1 of window 1 of process "Numbers"
--> {235, 694}
get position of outline 1 of scroll area 1 of splitter group 1 of splitter group 1 of window 1 of process "Numbers"
--> {387, 125}
get size of outline 1 of scroll area 1 of splitter group 1 of splitter group 1 of window 1 of process "Numbers"
--> {220, 1580}
get size of group 1 of outline 1 of scroll area 1 of splitter group 1 of splitter group 1 of window 1 of process "Numbers"
--> {220, 17}
set value of scroll bar 1 of scroll area 1 of splitter group 1 of splitter group 1 of window 1 of process "Numbers" to 0.757475083056
end tell
With this solution "Numbers" gets unfocused. To get it refocused I have to add "Tell application 'Numbers' to activate". Now it flashes a bit but anyway it works.
Thank you very much for your added "PageDown" and "PageUp" scripts.
Best Regards
Fred