How to get absolute page number with script?
Hi,
I'm working on a script where I'd like to know on which page a certain text appears.
I know that this works:
finds = doc.findText();
myPage = finds[0].parentTextFrames[0].parentPage.name;
But it gives me the name of the page, not the absolute number. I need to decide whether the page is within the first n pages of the document or not.
I have written a function which uses the for loop to go through the pages from 1 to n, and compares them to the id of myPage. It works, but I wonder if there is a more simple solution? Is there a way to convert to absolute numbering? Please advise.
