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

Calling script inside sdk

Contributor ,
Apr 22, 2020 Apr 22, 2020

Copy link to clipboard

Copied

Hi Everyone,

I have called script inside the sdk it build successfully. By using script i fetched the undo history list now, my doubt is how to display the history list in to dropdown which was designed in .fr file. Please do guide me on this......

-Jothi

TOPICS
SDK

Views

524

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

Contributor , May 30, 2021 May 30, 2021

I have done with my works.

 

Thanks,

-Jothi

Votes

Translate

Translate
Community Expert ,
Apr 23, 2020 Apr 23, 2020

Copy link to clipboard

Copied

Look at kDropDownListWidgetBoss, this is the boss class that represents the dropdown. For an example of how to add dropdown to the UI have a look at the WriteFishPrice sample plugin. The interfaces that you should look at is IStringListControlData. You can also look at Basicpersistence sample plugin also i see the code to add entries to dropdown in the BPIUIDlgController.cpp file, look at the method InitializeDialogFields

 

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
Contributor ,
Apr 27, 2020 Apr 27, 2020

Copy link to clipboard

Copied

Yeah! i have seen WriteFishPrice sample plugin. But, there is nothing like using script and then calling the values. I have used the below code in sample plugin to fetch and then display the undo history using script

void CustomHttpLinkUIObserver::loadFilesInDropdown()
{

// Find the dropdown widget ID = kFileListWidgetID
InterfacePtr<IScriptManager> scriptManager(Utils<IScriptUtils>()->QueryScriptManager(kJavaScriptMgrBoss));
InterfacePtr<IScriptRunner> scriptRunner(scriptManager, UseDefaultIID());
//Utils<IScriptArgs>()->Set("xmlTags", this->GetPluginPath() + "\\TBtags.xml");
PMString scriptCode;
scriptCode.Append("var UH = app.activeDocument.undoHistory;");
scriptCode.Append("alert(UH);");
PMString engineName("myengine");
int32 errorCode = Utils<IExtendScriptUtils>()->RunScriptInEngine(engineName, scriptCode);
//scriptRunner->RunScript(scriptCode);
Utils<IScriptArgs>()->Clear();
}

How i display the history list into dropdown list???

-Jothi

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
Contributor ,
May 30, 2021 May 30, 2021

Copy link to clipboard

Copied

LATEST

I have done with my works.

 

Thanks,

-Jothi

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