#target "InDesign"
var myDialog = app.dialogs.add({name: "Select Pages", canCancel: true});
with (myDialog) {
with (dialogColumns.add()) {
with (borderPanels.add()) {
var myRadioButtonGroup = radiobuttonGroups.add();
with (myRadioButtonGroup) {
var myPageEven = radiobuttonControls.add({staticLabel: "Even", checkedState: true});
var myPageOdd = radiobuttonControls.add({staticLabel: "Odd"});
var myPageAll = radiobuttonControls.add({staticLabel: "All"});
}
}
}
}
if (myDialog.show() == true) {
if (myRadioButtonGroup.selectedButton == 0) {
SelectPage(1);
}
else if (myRadioButtonGroup.selectedButton == 1) {
SelectPage(0);
}
else if (myRadioButtonGroup.selectedButton == 2) {
app.activeDocument.pages.everyItem().select();
}
myDialog.destroy();
}
function SelectPage(i) {
var myDocument = app.activeDocument;
var myPages = myDocument.pages;
//i=0 - odd; i=1 - even
for (i; i < (myDocument.pages.count()); i = i + 2) {
myPages.item(i).select(SelectionOptions.ADD_TO);
}
}