Reload Script Panel
Is there a way to force an extendScript Panel to reload (on a e.g. a button click)? I dont mean to rebuild its UI with the layout manager, but something similar to closing the panel and starting it anew from Window/myPanel.jsxbin.
Why I want to do this: I've got template projects that are controlled with specific UI panels. To ensure that the opened project works with one specific panel, I have an empty comp named "DOCKABLE_ENABLED_MyTemplateName". The panels are looking for this comp-name and enable/disable their elements depending on whats found (or not).
mainPSGrp.enabled = false;
for (i = 1; i <= app.project.numItems; i++){
if ((app.project.item(i) instanceof CompItem) && (app.project.item(i).name == "DOCKABLE_ENABLED_Template_One")){
mainPSGrp.enabled = true;
}
}
The problem is, that if this panel is opened before loading the AET (with disabled controls) it won't enable them on load of the template. I have to manually close and reopen it again. And thats something I'd like to avoid.
