// Current Page Number
var myFinds = app.findTextPreferences.findWhat = "^N";
// Any Page Number
var myFinds = app.findTextPreferences.findWhat = "^#";
Thanks for your reply...
Anyhow I couldn't get the exact result what I want..
Consider If I need to get the page number "2" using Find command , It takes the argument 2 as string. But autonumber page is in number format..Thus it returns "Cannot find match".
How can I convert it into integer through script.
//To convert from a string to an integer:
myNumber = parseInt("2");
Thanks for your reply....
I need to find a number in a document. The number is 2 or 3 or something else. The number 2 is not present in the document as a running text or text. It is auto page number. like if i copy the number in the text box and paste in find dialog box means it'll like this "<0018>". This number is common for all auto page numbers. This number will be either 2 or 3. But how can i get the particular number from this auto page number through script. Am using InDesign CS3.
Thanks in Advance.
The "value" of an Auto Page Number is not fixed -- it displays (quite logically) the "value" for the current page number. So you cannot search for an "Auto Page Number with the value x".
This shows a way to get a value for the placeholder:
app.findTextPreferences.findWhat = "^N";
var myFinds = app.activeDocument.findText();
alert ("This is page "+myFinds.parentTextFrames.parent.name);
Note that the parentTextFrames.parent construction only works for regular text frames on regular pages. If you want to search for any page number in any type of frame on any type of page (i.e., also on master pages), you will have to check the type of parent yourself.
Thank you very much jongware...