Forum Discussion
tristaanogre
9 years agoEsteemed Contributor
We do something similar. At the bottom of the panel that opens up is a text that says something like
"Showing 11 through 20 of 51" or something like that. What we do is we parse that sentence in JavaScript using split
var textItems = Aliases.myApp.myPanel.myTextLabel.contentText.split(' ')
Then we do a comparison of the 4th word to the 6th word. If they are not equal, we click "Next" to go to the next page. If they are equal, we know we are on the last page. That's done with textItems[3] compared to textItems[5].
This is just one method but it works for our situation. Other options are to check the status of the "Next" button. I'm assuming the next button is disabled when you get to the last page so checking for "disabled == true" or "enabled == false" on that Next button would be a good check as well.