Fetching page count values
Copy link to clipboard
Copied
Hi,
I need to fetch the values of page count so that I have called the JavaScript functionality. But I won't get the values inside the panel at the sametime it displaces the Javascript code into textbox. Please guide me on this
PMString scriptCode;
scriptCode.Append("var PageCount = app.activeDocument.pages.length;");
scriptCode.Append("alert(PageCount);");
K2Vector<WideString> values1;
InterfacePtr<IBPISuite> bpiSuite1(fCurrentSelection, UseDefaultIID());
if (bpiSuite1 && bpiSuite1->CanGetBPIData()) {
bpiSuite1->GetBPIData(values1);
}
// Update the data displayed in the panel's widgets.
InterfacePtr<IPanelControlData> panelControlData1(this, UseDefaultIID());
ASSERT(panelControlData1);
if (!panelControlData1) {
break;
}
// Display each string returned by the suite in a line in the multi line widget.
IControlView* textControlView1 = panelControlData1->FindWidget(kPageCountTextEditBoxWidgetID);
ASSERT(textControlView1);
if (!textControlView1) {
break;
}
InterfacePtr<ITextControlData> textControlData1(textControlView1, UseDefaultIID());
ASSERT(textControlData1);
if (!textControlData1) {
break;
}
textControlData1->SetString(scriptCode);
} while (false);
Copy link to clipboard
Copied
answered at https://community.adobe.com/t5/indesign/how-to-get-page-count-in-c/m-p/11199905?page=1
duplicate thread/spam, locked
