Highlighted

Reload Script Panel

Explorer ,
Apr 16, 2020

Copy link to clipboard

Copied

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.

Adobe Community Professional
Correct answer by justintaylor | Adobe Community Professional

You could just run the check function again when your panel is focused. Or you could add a refresh button that re-runs the check.

TOPICS
How to, Scripting

Views

297

Likes

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

Reload Script Panel

Explorer ,
Apr 16, 2020

Copy link to clipboard

Copied

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.

Adobe Community Professional
Correct answer by justintaylor | Adobe Community Professional

You could just run the check function again when your panel is focused. Or you could add a refresh button that re-runs the check.

TOPICS
How to, Scripting

Views

298

Likes

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
Apr 16, 2020 0
Adobe Community Professional ,
Apr 17, 2020

Copy link to clipboard

Copied

You could just run the check function again when your panel is focused. Or you could add a refresh button that re-runs the check.

Likes

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
Reply
Loading...
Apr 17, 2020 0
Explorer ,
Apr 17, 2020

Copy link to clipboard

Copied

Good Point, I'll try that, thanks. Sometimes its the simplest things 😉

Likes

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
Reply
Loading...
Apr 17, 2020 0
Explorer ,
Jun 16, 2020

Copy link to clipboard

Copied

Finally found the time to implement the refresh button, works great!

 

Corvin0_0-1592297670747.png

var refreshButton = myRow2.add("button",undefined,'\u21BA');
refreshButton.onClick = function () {checkEnabled ();}
myRow1.enabled = false;
/******************************************************************
    
////////////////////      Check if opened AE Project is dockable ready   //////////////////// 
    
******************************************************************/
function checkEnabled () {
for (i = 1; i <= app.project.numItems; i++){
		if ((app.project.item(i) instanceof CompItem) && (app.project.item(i).name == "DOCKABLE_ENABLED_PULS4")){
myRow1.enabled = true;
		}
	}
}

checkEnabled ();

Likes

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
Reply
Loading...
Jun 16, 2020 0