Copy link to clipboard
Copied
There is a very useful Adobe CC extension called Adobe Scripts Panel, which is essentially a panel that lets you run scripts on the fly without having to go to File > Scripts > Select Script in Photoshop or Illustrator:
It's enormously useful, but it has a major bug where it won't run a selected/clicked script when you first open the panel. Instead, it errors out saying:
ERROR: TARGET COULD NOT BE LAUNCHED
However I figured out that if I click the top right menu and select Reload Panel, and then select a script, it runs fine!
Example:
But if I collapse the panel and then re-open, it no longer works again, and I have to select Reload Panel again to get it to work.
I've tried digging into the JavaScript code for the extension, and I just cannot figure out how to fix this. I thought that I could easily fix it by forcing a panel reload automatically when the extension panel is expanded/opened, but everything I tried failed.
I'm desperately hoping that someone here with JavaScript and Adobe scripting knowledge might know of a way to fix this bug as the author of the script doesn't seem to be actively maintaining it.
From my limited analysis of the code, I've found the portion that is responsible for the "Reload Panel" event in main.js:
// Reloads extension panel
var menuXML = '<Menu> \
<MenuItem Id="reloadPanel" Label="Reload Panel" Enabled="true" Checked="false"/> \
<MenuItem Id="debugPanel" Label="Debug" Enabled="true" Checkable="true" Checked="false"/> \
<MenuItem Label="---" /> \
<MenuItem Id="reference" Label="Script Reference" Enabled="true" Checked="false"/> \
</Menu>';
csInterface.setPanelFlyoutMenu(menuXML, flyoutMenuCallback);
csInterface.addEventListener("com.adobe.csxs.events.flyoutMenuClicked", flyoutMenuCallback);
csInterface.setContextMenu(menuXML, flyoutMenuCallback);
csInterface.addEventListener("com.adobe.csxs.events.contextMenuClicked", flyoutMenuCallback);
var debugPanel = false;
function flyoutMenuCallback(event){
var menuId = event.type && event.data ? event.data.menuId : event;
if(menuId == 'reloadPanel'){
location.reload();
}else if(menuId == 'debugPanel'){
toggleDebug();
}else if(menuId == 'reference'){
window.cep.util.openURLInDefaultBrowser(refURL);
}
}
Specifically location.reload(); is what I believe initiates a panel reload. I just can't figure out how to leverage this information to fix the problem.
Please, any help at all would be hugely appreciated as this plugin is a huge time saver and QOL booster.
Thanks so much.
Copy link to clipboard
Copied
After all contact the author in first instance if you didn't yet, even if he doesn't manage it on his page.
Copy link to clipboard
Copied
I opened an issue on the Github repo. I'll see if I can find a more direct way to contact him.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now