Highlighted

Fetching page count values

Explorer ,
May 28, 2020

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);

-Monisha
TOPICS
How to, Scripting, SDK

Views

242

Likes

Translate

Translate

Report

Report
This conversation has been locked.

Fetching page count values

Explorer ,
May 28, 2020

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);

-Monisha
TOPICS
How to, Scripting, SDK

Views

243

Likes

Translate

Translate

Report

Report
May 28, 2020 0
Adobe Employee ,
Jun 11, 2020

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

Report
Jun 11, 2020 0