Hi all, I'm trying to fix a bug I have with my extension. It consists of 2 panels. One is the Main panel. The other is an Invisible panel that dispatches an event to the Main panel. This way I can set up a shortcut that opens the Invisible panel and triggers a function in the Main panel. The Invisible panel runs this code (function copyFunction () {
'use strict';
var csInterface = new CSInterface();
var event = new CSEvent("copyShortcut", "APPLICATION");
event.data = "Copy";
csInterface.dispatchEvent(event);
csInterface.closeExtension();
}()); ...and it works almost fine. The last command csInterface.closeExtension() though, often freezes After Effects for a few seconds (sometimes takes longer, sometimes it doesn't even freeze), which makes the whole shortcut trick a pain in the ass. I've noticed a couple of things though. First one: if in the manifest file I change these settings for the Invisible panel from <AutoVisible>false</AutoVisible>
<Type>Custom</Type> to <AutoVisible>false</AutoVisible>
<Type>Panel</Type> ...nothing freezes! It runs very smooth. Nice! The drawback is that the Invisible panel is not invisible anymore. It quickly appears then disappears. Moreover, if I keep this settings <AutoVisible>false</AutoVisible>
<Type>Custom</Type>​ and remove the line csInterface.closeExtension(); the first time I open the panel it performs well (and it's invisible), but the second time (as its already open) it doesn't trigger the function (as expected) and becomes visible!! If I try to manually close it, the panel disappears but it's actually still open. There is no way to both keep the panel invisible and close the panel without freezing AE. Any help? I was thinking about leaving the Invisible panel always open and find a way to trigger a function when onfocus or something... any ideas?
... View more