Copy link to clipboard
Copied
Some MacOSX users get this error:
"An attached script generated the following error:
CSXSEvent does not have a constructor
Do you want to disable this event handler"
...when running our CEP Extension ( HTML5 / JS / JSX ).
The user who reports it is running CC 2015.2. The message is showing for almost everything she does in the user interface, but most actions (perhaps all) are working despite the annoying message.
For the first user (it might have been CC 2014 then) with this problem, the error was suddenly gone. He had not checked the "Don't show again" checkbox.
It seems this error is only on Mac. Users running Windows, including myself don't have the issue.
(There is also an initial "I/O error" for the user, when starting the application, but that might not have anything to do with the CSXSEvent.)
With CEP6 the plugplug library is included so doesn't need to load it from a external file. One can just use the method that Loic showed
var mylib = new ExternalObject( "lib:PlugPlugExternalObject" );
Did you try that before doing what you described in #12?
If not, try it and see if it works
Copy link to clipboard
Copied
Hi Andreas,
You need to load the PlugPlug library in order to instantiate CSXSEvent objects at the ExtendScript level.
var externalObjectName = "PlugPlugExternalObject";
var mylib = new ExternalObject( "lib:" + externalObjectName );
then you can instantiate CSXSEvents
var eventObj = new CSXSEvent();
eventObj.type="documentCreated";
eventObj.data="blahblah";
eventObj.dispatch();
Hope that helps
Loic
www.ozalto.com
Copy link to clipboard
Copied
I am loading the PlugPlug library, and so far I've never seen these errors on Windows, but users on Mac are reporting them.
Looking through the resource files for the code, I should probably update my CSInterface.js file, from this link, since my version is 5.2, and there are versions >6 now.
https://github.com/Adobe-CEP/CEP-Resources/tree/master/CEP_6.x
There seem to be no new versions of PlugPlugExternalObject since 2014: https://github.com/Adobe-CEP/CEP-Resources/releases/tag/1
Copy link to clipboard
Copied
Hi Andreas,
At the very least, you could try to investigate if within the CSInterface library, you can find the following code
/**
* @class CSEvent
* A standard JavaScript event, the base class for CEP events.
*
* @param type The name of the event type.
* @param scope The scope of event, can be "GLOBAL" or "APPLICATION".
* @param appId The unique identifier of the application that generated the event.
* @param extensionId The unique identifier of the extension that generated the event.
*
* @return A new \c CSEvent object
*/
function CSEvent(type, scope, appId, extensionId)
{
this.type = type;
this.scope = scope;
this.appId = appId;
this.extensionId = extensionId;
};
There is no reasons why you wouldn't find it but just in case. Try updating the library if needed.
Let us know how that goes.
Loic
Copy link to clipboard
Copied
Yes, the CSEvent function above exists in the CSInterface library and looks fine.
I've updated the add-on with the latest CSInterface file, but due to installation problems, add-ons are not installed or automatically updated at the users computers, so I don't know the result yet. Users don't get the update. According to this post Re: CC2015 Extensions gone the issue with extensions not appearing in InDesign should have been resolved in a "Creative Cloud desktop app" update, but I'm not certain whether Adobe means that you should still – after six months – have to download a specific version of the CC desktop app manually. I'm positive that there have been automatic updates after that was written, and I guess that the link in that post by Monica Singh is leading to the latest version of the CCDesktopApp: https://creative.adobe.com/products/download/creative-cloud so I don't know what to make out of it.
Monica Singh wrote that "it is not an auto update hence you are required to download the patch and then install manually."
The persons responsible for installations at the company where the extension is installed, say that the synchronization does not work, no matter what version of Creative Cloud Desktop App they install, but they are investigating further.
I'll keep you posted.
Thanks,
Andreas
Copy link to clipboard
Copied
The joyful world of what should work but doesn't…
Loic
Copy link to clipboard
Copied
The update with the newest CSInterface file was put on place (manually) today.
The CSXSEvent error is still there on Mac, and so is the "I/O error".
The errors are not present on Windows, and the interface seems to work on Mac, but with these warnings showing up.
Copy link to clipboard
Copied
Some first-hand experience on Max OSX now.
I've seen the I/O error so far, but not yet the CSXSEvent error (it might be I need some more parts in order on the Mac that I'm testing on to get to that, don't know yet).
I'm using the code below to load the PlugPlug library, I believe I got it from Olav Kverns introduction (Change as a Way of Life: CC Extensions and the Third-Party InDesign Developer).
//This function takes care of loading the PlugPlugExternalLibrary object on
//the ExtendScript side. We'll use this object to send InDesign event notifications
//and data back to the JS side of the extension.
function loadPlugPlugLibrary(){
var csInterface = new CSInterface();
//Determine the plaform, so that we can direct our ExtendScript to the correct version.
var osInformation = csInterface.getOSInformation();
// alert(osInformation);
var plugPlugFile;
if(osInformation.match(/Mac OS/gi)!== null){
plugPlugFile = csInterface.getSystemPath(SystemPath.EXTENSION) + "/jsx/libraries/PlugPlugExternalObject-Mac/osx10_64/PlugPlugExternalObject.framework";
// alert(plugPlugFile);
}
else{
if(osInformation.match(/64-bit/gi) !== null){
plugPlugFile = csInterface.getSystemPath(SystemPath.EXTENSION) + "/jsx/libraries/PlugPlugExternalObject-Win/win64/PlugPlugExternalObject.dll";
}
else{
plugPlugFile = csInterface.getSystemPath(SystemPath.EXTENSION) + "/jsx/libraries/PlugPlugExternalObject-Win/win32/PlugPlugExternalObject.dll";
}
}
plugPlugFile = escape(plugPlugFile);
alert(plugPlugFile);
csInterface.evalScript('loadPlugPlugLibrary("' + plugPlugFile + '")');
alert('2');
}
At line 24 the alert-box shows this path:
/Library/Application%20Support/Adobe/CEP/extensions/cc.idp/jsx/libraries/PlugPlugExternalObject-Mac/osx10_64/PlugPlugExternalObject.framework
... and by right-clicking in the alert-box I can select to show that file path in the Finder. Doing so, the Finder shows up at this path. Seems ok to me.
But then the I/O error message is shown (between line 24 and line 26).
I temporarily went into system settings and allowed all programs to be trusted, not only the ones downloaded from "Store" etc... and restarted InDesign and the Extension, but I got the exact same error.
I don't know what to make out of it.
Thanks,
Andreas
Copy link to clipboard
Copied
Hi,
Probably just a formatting thing. There is a space "rnalO bje".
P.
Copy link to clipboard
Copied
Yes, you are right. It seems to be a formatting thing. I checked the results text file where I had saved the output from the mac alert box, and there it says
/Library/Application%20Support/Adobe/CEP/extensions/cc.idp/jsx/libraries/PlugPlugExternalObject-Mac/osx10_64/PlugPlugExternalObject.framework
(without the space that was in my message above.)
But thanks, for noticing!
Copy link to clipboard
Copied
The code above was from the js file.
I will have to go on and find out what line in the jsx file it is that the error is taking place. But it will probably be after the holidays (just to remind myself) :
//Load the PlugPlugExternalObject library. We use this external object to pass
//events back to the user interface of the extension.
//The file path is passed to this function from the JS/HTML side of the extension.
function loadPlugPlugLibrary(filePath){
//filePath is escaped, so unescape it before using it.
filePath = unescape(filePath);
try {
var externalLibrary = null;
var plugPlugLibraryFile = File(filePath);
if (plugPlugLibraryFile.exists) {
var externalLibrary = new ExternalObject("lib:"+ plugPlugLibraryFile.fullName);
var data = "PlugPlug library successfully loaded!";
var csxsEvent = createCSXSEvent("plugPlugSuccess", data);
csxsEvent.dispatch();
}
else {
throw new Error("Can't find PlugPlugExternalObject: " + plugPlugLibraryFile.fullName + " File: " + $.fileName + " Line: " + $.line);
}
}
catch(error){
alert(error);
}
}
Copy link to clipboard
Copied
I found a few threads about I/O errors and ExternalObject:
https://forums.adobe.com/thread/1444959?tstart=0 reads: " it turned out to be OSX Deployment Target setting under Build Settings > Deployment of the target. I had to switch to OS X 10.8 for it to work."
https://forums.adobe.com/thread/1445754?tstart=0 reads: "I got it, the framework is for 32 bit not 64 bit"
https://forums.adobe.com/thread/1245938?start=0&tstart=0 reads: "In Windows 64, if your application is compiled 64bit then you can only access InDesign 64bit and its object library. However if your app is 32 bit then you can only access InDesign 32bit and its object library."
But could 32/64 bit differences be an issue using HTML5/JS/CEP?
Copy link to clipboard
Copied
With CEP6 the plugplug library is included so doesn't need to load it from a external file. One can just use the method that Loic showed
var mylib = new ExternalObject( "lib:PlugPlugExternalObject" );
Did you try that before doing what you described in #12?
If not, try it and see if it works
Copy link to clipboard
Copied
Wow... I never noticed any news about it being added as an embedded resource to InDesign!
(I just thought that Loic had left out the path in the sample code, or that it was from some generic example, since some of the other applications has had it builtin for some time.)
Was there an announcement from Adobe that I missed? Anyway it seems to work..! 🙂
At least my own Windows computer. I'll make a new version and ask the one of the Mac users to try it out as well.
Would you happen to know why there is a backslash in some online code samples? As in the second line below:
var externalLibrary = new ExternalObject("lib:PlugPlugExternalObject");
var externalLibrary = new ExternalObject("lib:\PlugPlugExternalObject");
Copy link to clipboard
Copied
I saw it in the extensions SDK, for AI and PS it's been like that for a couple of versions for ID I think it's been since 2014 or maybe 2014.1.
I don't know why the examples don't do it the simple way without a \.
I don't know why they use 2 variables in other examples either.
var plugPlugExternalObject = PlugPlugExternalObject;
var externalLibrary = new ExternalObject("lib:" + PlugExternalObject);
Really what's the point?
I was really unimpressed with the SDK documentation, it looks like something straight out of google translate.
They really messed up badly with CEP 6.1 and nodejs (IO.js).
Either way, please mark the question as answered either Loic's or my answer.
Copy link to clipboard
Copied
Thanks!
If this change makes the I/O or CXSXEvent errors on Mac go away, I'll be sure to mark your answers as correct! But it'll be a few days until we can test it. I'll write again then.
Copy link to clipboard
Copied
Glad we could help. I was looking closely at that thread because i's always interesting to share experiences of those grey areas where as I said previously things should work but doesn't and on top of that how to deal with it.
Loic
Copy link to clipboard
Copied
Hello, I need your help. What about CC 2014. I am getting I/O Error for Indesign CC 2014 when I am loading the PlugPlugExternalObject.
Copy link to clipboard
Copied
Have you tried the Extension Builder forum ? You may found more concerned people there
Copy link to clipboard
Copied
Yes, it worked!
The user with the I/O and CSXSEvent errors has tested the new version, and the errors were gone!
Thanks again!
Copy link to clipboard
Copied
In my initial question I wrote that the first one of our users who experienced this error "had not checked the "Don't show again" checkbox" when the error went away.
It turns out that this was not necessarily true, since I found another mail where it seems he did uncheck that very checkbox, but I'm not quite sure whether that was an earlier installation.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now