• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Refreshing the content

Participant ,
Jul 10, 2020 Jul 10, 2020

Copy link to clipboard

Copied

Hi,

For my concern company, we have a plugin to display the document name and some count values. In that plugin we have fetched and bind the values into the panel, but I cannot refresh the values without closing the panel. For that I have used this code

 

InterfacePtr<IScriptManager> scriptManager(Utils<IScriptUtils>()->QueryScriptManager(kJavaScriptMgrBoss));
InterfacePtr<IScriptRunner> scriptRunner(scriptManager, UseDefaultIID());
PMString importScript;
PMString documentName;
importScript.Append("app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract;");
importScript.Append("var documentName = app.activeDocument.name;");
//importScript.Append("alert(documentName);");
importScript.Append("app.scriptArgs.set(\"documentName\",String(documentName));");
importScript.Append("app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;");
PMString engineName("myengine");
int32 errorCode = Utils<IExtendScriptUtils>()->RunScriptInEngine(engineName, importScript);
documentName = Utils<IScriptArgs>()->Get("documentName");
CAlert::InformationAlert(documentName);
Utils<IScriptArgs>()->Clear();

 

// Update the data displayed in the panel's widgets.
InterfacePtr<IPanelControlData> panelControlData(this, UseDefaultIID());
ASSERT(panelControlData);
if (!panelControlData) {
break;
}


// Display each string returned by the suite in a line in the multi line widget.
IControlView* textControlView = panelControlData->FindWidget(kDocumentNameTextEditBoxWidgetID);
ASSERT(textControlView);
if (!textControlView) {
break;
}
InterfacePtr<ITextControlData> textControlData(textControlView, UseDefaultIID());
ASSERT(textControlData);
if (!textControlData) {
break;
}

textControlData->SetString(documentName);

 

please guide me on this..

-Monisha
TOPICS
How to , Scripting

Views

238

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Jul 10, 2020 Jul 10, 2020

Search the SDK for ActiveSelectionObserver, e.g. CustSEObserver or LinksUIPanelTreeObserver get close.

Also drop that convoluted script call and glue - have a look at IDocument.

Votes

Translate

Translate
Guide ,
Jul 10, 2020 Jul 10, 2020

Copy link to clipboard

Copied

LATEST

Search the SDK for ActiveSelectionObserver, e.g. CustSEObserver or LinksUIPanelTreeObserver get close.

Also drop that convoluted script call and glue - have a look at IDocument.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines