Skip to main content
Participating Frequently
November 6, 2024
Question

JSFL/XMLUI menulist/menupop help

  • November 6, 2024
  • 1 reply
  • 767 views

I am new to Animate (2024) scripting, but have created CEP Panels/extendscript for AE and PPro.

 

This forum has been very useful (especially  @JoãoCésar17023019 )  as there is a lot of outdated documentation that can be confusing.

 

Basically, I just want a UI for our pipeline. First part is reading a folder on our server and populating a dropdown with the names of all the job folders. 

 

I can read the job names (folder names) into an array and then use a loop to create the xml with all the menulist menuitems. I will have other dropdowns that need to be populated based on other dropdowns.

How would I update a dropdown with new items? Do I somehow close the dialog, create a new xml and open it again?

 

I was looking at https://github.com/AdobeDocs/developers-animatesdk-docs/blob/master/XMLUI_object/xmlui8.md

fl.xmlui.setControlItemElements("myControlID", arrayOfElementObjects);


This is exactly what I need. I create the arrayOfElementObjects and add id to my menulist(tried menupop too), but it doesn't work. The docs say it is for comboboxes and listboxes, but I am not sure how to create these? 

I hoping someone can help me with what is possible in today's animate. 

thank you



 

 

This topic has been closed for replies.

1 reply

JoãoCésar17023019
Community Expert
Community Expert
November 6, 2024

Hi.

 

Glad to know that the forums have been useful to you!

The approach that I use is to modify the panel's XML string by adding as much <menuitem/> elements as I need.


These two examples may give you an idea:
https://github.com/joao-cesar/adobe/tree/master/animate%20cc/jsfl/change_font_face

https://github.com/joao-cesar/adobe/tree/master/animate%20cc/jsfl/replace_unavailable_fonts

This page is old but it has the most complete reference of the XMLUI elements that can be used:
https://web.archive.org/web/20121223105042/http://photoshop-flash-coreldraw-seo-help.com/adobe-flash-help-tutorials/control-tag-summary-of-xml-to-ui-in-flash.html

Please let us know if you still need help.

 

Regards,

JC

Participating Frequently
November 7, 2024

Thank you for your reply and example!

 

I am wondering that once you create the menuitems xml and then create the dialog with fl.xmlPanelFromString, is it possible to then change the menuitems in the same dropdown? In extendscript scriptUI it is done by clearing the items and adding new ones. 


Also, your example has the same issue I was seeing in my tests. The dropdown only opens when you click along the bottom of the dropdown. I found that if I just move it later in a dialog eg. after another hbox, it behaves properly. ie. I can click anywhere in the dropdown and it opens. (this is Animate 2024 on windows).

 

Thank you again!

JoãoCésar17023019
Community Expert
Community Expert
November 7, 2024

You're welcome.

 

What do you mean by changing the menuitems in the same dropdown?

As for the second issue, are you referring to a bug in which the dropdowns cannot be opened by clicking on them?