Copy link to clipboard
Copied
A colleague is working on an extension panel for PS and Illustrator. Running the panel goes just fine and he can reload/refresh it after doing changes in for example: the jsx-file.
But that only applies to Photoshop. Trying to reload in a similiar manner in Illustrator just doesn't work.
Is this a known issue? Do you really have to restart the application in order to reload a extension in Illustrator?
Copy link to clipboard
Copied
Create arbitrary button and add it to the event:
your_button.addEventListener('click', function (event) {
location.reload();
});
Copy link to clipboard
Copied
If you make changes to the html/css/js part of the panel, the panel can be reloaded, as Alexander Ladygin said above.
If changes are made to the ExtendScript-file, you'll have to kill the CEP-process or restart Illustrator.
It seems so. But I don't remeber where it was said in documentation...
Copy link to clipboard
Copied
In this case, for development purposes, (and I am starting to try and to mess more with CEP these days), I would make sure that my .jsx scripts would be made 'generic' and have one purpose: to read and execute other .jsx scripts which live in some other folder.
It seems like a good idea to me from reading the above. But I'll really have to test for myself.
Copy link to clipboard
Copied
I do not know about you, but I have updated all of the extension. Alternatively, you can use another method :
Create arbitrary button and add it to the event:
your_button.addEventListener('click', function (event) {
new CSInterface().closeExtension();
});
Collapse panel. Result reloar extension.
Copy link to clipboard
Copied
But in Illustrator CC2015.3 x64 En on Windows10x64pro this futures don't work, or I have a bug:
panel restart empty, without content... I have to restart Illustrator, to the contents of the panel displays.
Copy link to clipboard
Copied
Hi, Alexander Ladygin!
How to launch the extension panel automtically after rebut (when using method new CSInterface().closeExtension())?
Updated
PS.
I'm trying
csInterface.requestOpenExtension(csInterface.getExtensionID(), "");
but it doesn't work
Copy link to clipboard
Copied
Hi, o-marat!
As an option:
Create a new extension, сreate in it arbitary button and add to it an event:
your_button.addEventListener('click', function (event) {
new CSInterface().requestOpenExtension('is an extension ID you want to restart', '');
});
Now procedure:
1. Execute the function new CSInterface.closeExtension(); in the extension that you want to restart;
2. Now in the new extension, click on the button, and the extension must be started again.
p.s. It works for me, illustrator cc 2014
p.s.s after you have performed the function new CSInterface.closeExtension(); of all subsequent commands will not be executed because extension was closed and discharged, at least in my case works
Copy link to clipboard
Copied
Alexander, thank you very much! It work in Illustrator CC 2015.3 too.
That's funny. To completely reboot panel need a second panel )))
Copy link to clipboard
Copied
To see the changes in the ExtendScript-part without restarting of Illustrator I just kill ALL CEP-processes through the creation of on-the-fly temporary batch file (bat or cmd).
Then collapse and expand panel.
But it work and only under Windows. And I think it needs local admins rights.
Code for .jsx
function killCEP () {
/**
* make bat-file that kill all system processes CEPHTMLEngine.exe
*/
_execFile (
Folder.temp.absoluteURI + '/' + 'taskkil.bat',
'taskkill /IM CEPHTMLEngine.exe /f'
);
/**
* make new file by full path, write to disk with some file contenr, execute file
*
* @param {String} filePath - FULL path (include file-extension)
* @param {String} fileContent - content to new file
*/
function _execFile (filePath, fileContent) {
var f = new File (filePath);
f.open ('e');
f.write (fileContent);
f.close ();
f.execute ();
}
}
Code for .js
$ ("#btn_killCEP").click (function () {
csInterface.evalScript ("killCEP()");
});
Find more inspiration, events, and resources on the new Adobe Community
Explore Now