Copy link to clipboard
Copied
Hi,
I have an code to bind the numeric values inside the panel. Can someone provide me some guidelines. And I have attached the doubt code which is used in my code
PMString importScript;
importScript.Append("alert( app.activeDocument.stories[i].words.length);");
PMString scriptCode("wordcode");
int32 errorCode = Utils<IExtendScriptUtils>()->RunScriptInEngine(scriptCode, importScript);
Utils<IScriptArgs>()->Clear();
// Use the suite to access the data.
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(int32(scriptCode));// which I have used to convert String to int32 values
} while (false);
Copy link to clipboard
Copied
Look at the following method of PMString
int32 PMString::GetAsNumber
-Manan
Copy link to clipboard
Copied
After adding the code it displays like this...
Copy link to clipboard
Copied
I don't see any numeric value in the values that are displayed in your screenshot. How do you think this method should convert these string values into a number. Can you please enlighten us on what should happen according to you
-Manan
Copy link to clipboard
Copied
I want to display the page count value inside the panel dynamically for that I have written the code in JavaScript. But it displays the script code inside the panel and for the reference I have attached the code above
Copy link to clipboard
Copied
Here you are saying that you have called the method but the results are not as you expected, and today you post another thread that says you are not able to call the method.
What is going on here?
-Manan
Copy link to clipboard
Copied
I have solved this issue and now it works fine using C++ code not after binding the Javascript inside the sdk. And thanks for the suggestions