This is a bit of an odd way of doing it, so I'm not surprised you're
getting problems. I think the main reason it's not working is that the
script does not wait for the search window to perform the search, it simply
continues on running, so all the values in your array are 0. You can either
insert a short pause in the execution of the command after the query, or
you can search the document yourself using the getPageNthWord method. The
latter is more complicated to implement (especially with long search
terms), and might take longer to execute, but you have much better control
over how it works.
On Thu, May 29, 2014 at 1:09 PM, control1982 <firstname.lastname@example.org>
hi, thanks for your reply, in code, i just list only 2 string for testing, actually i have 13 string. i want to know the page num of them first time appear in this pdf file.
"You can either insert a short pause in the execution of the command after the query" I do not quite understand this sentence? Is this can help me achieve my desired function?
how to code? thanks a lot
is there a method can unselect the search result? or can move the focus to the first page?
No. You can't interact with the search window using a script.
It doesn't matter if it's 2 or 13 strings.... You'll encounter the same
problem in both situations.
See the setTimeOut method of the app object regarding delaying the
execution of a command.
On Thu, May 29, 2014 at 1:50 PM, control1982 <email@example.com>
all of these strings in Array are appear on the first row of each page.
is there a method can read a first row on each page?
Not directly, no. It's possible to limit a search that is performed with getPageNthWord to a specific area of the page, but that's very complex to implement.