Exclude the Roman Numerals Number Page Section
Hello!
In my Indesign document, normally my first pages are in Roman Numerals like you can see:

After I use the normal numbers like you can see:

Is there a script to know which number page start my normal number 1?
For example, if my document has the next pages:
I, II, III, IV, V, VI, VII, 1, 2, 3, 4, ...
this means my page 1 is in the number 8.
Here is the code but didn't works, because they find nothing in the number pages:
var doc = app.activeDocument;
// clear find change text preferences before search
app.findTextPreferences = app.changeTextPreferences = NothingEnum.NOTHING;
// this is scripting equivalent of the 'Find What:' edit text field
app.findTextPreferences.findWhat = "1";
// search it in the active document
// you can also search it in almost everywhere: story, text frame, paragraph, line, word, etc
var finds = doc.findText();
if (finds.length > 0) { // something has been found
// for the 1st found item display the name of the page where the 1st text frame (there can be several threaded frames) containing it is located
alert("Found " + finds.length + " items, the first of them is on page " + finds[0].parentTextFrames[0].parentPage.name);
}
else { // found nothing
alert("Nothing has been found");
}
// clear find change text preferences after search
app.findTextPreferences = app.changeTextPreferences = NothingEnum.NOTHING;
Maybe is helpful to know my number pages always have the style called Book Page Number and is inside of my folder VARIOUS
I try also do this, but the script didn't find the number 1:
var myDoc = app.activeDocument,
arrayRomanNumerals = ["1"],
I = arrayRomanNumerals.length, i;
app.findTextPreferences = null;
for ( i = 0; i < I; i++) {
app.findTextPreferences.findWhat = arrayRomanNumerals;
myFound = myDoc.findText();
var J = myFound.length, j;
var styleBookPageNumber = myDoc.paragraphStyleGroups.itemByName("VARIOUS").paragraphStyles.itemByName("Book Page Number");
for ( j = 0; j < J; j++) {
myFound
.appliedCharacterStyle = myDoc.characterStyles[0]; if (myFound
.appliedParagraphStyle == styleBookPageNumber) { alert("Found!"); }
else{break;}}}
Thanks so much.
