CS4 Works, CS5 Errors

General Discussion of Scripting for Flex, Flash & CS SDK

Moderators: Tom, Kukurykus

cameronmcefee

CS4 Works, CS5 Errors

Post by cameronmcefee »

Hello,

I'm running into errors when using my Photoshop panel in CS5. I've been using trials of Flash Builder 4 on various machines and each time I have to set the environment up I seem to run into new issues. As of the last machine I was on, it was functioning fine in both CS4 & 5, but now CS5 outputs:

Code: Select all3/9/2011 07:50:16.600 [DEBUG] com.adobe.csxs.external.CommunicationUtils [DispatchingRequest functionName="findMiddleSuspender" params="true|true"]
------------------
3/9/2011 07:50:16.600 [ERROR] com.adobe.csxs.external.CommunicationUtils [Error in request data, it is null where some data is expected ]
------------------
3/9/2011 07:50:16.601 [INFO] com.adobe.csxs.external.CommunicationUtils [RequestResult after parsing result="[RequestResult status="RequestResultInvalid" data=null]" ]
------------------
3/9/2011 07:50:16.602 [DEBUG] com.adobe.csxs.external.CommunicationUtils [Result="[RequestResult status="RequestResultInvalid" data=null]"]
------------------

I can't find any documentation on external.CommunicationUtils, so I'm not sure at what point the error is being thrown.

The function call (mxml):

Code: Select allprivate function findMiddle_StageBoth(event:Event):void {
   CSXSInterface.instance.evalScript("findMiddleSuspender", "true|true");
}


The function (jsx):
Code: Select allfunction findMiddleSuspender (a) {
   app.activeDocument.suspendHistory("Find Middle", "findMiddle(a)");
   // All the parameter parsing happens in the next function. I left this in here for reference, but even something as simple as alert(a) throws the error. I'm not sure where that means the script is having problems.
}

My current setup:
• Flash Builder 4
• SDK: CS Flex SDK 3.4.0 (Also tried Flex 3.5 and Flex 4)
• Libs: CSXSLibrary.swc (Don't recall where I got it. CSXSLibrary-2.0-sdk-3.4-public.swc that comes with the SDK and Panel Dev Guide both cause errors with the Air Logger)
Mike Hale

CS4 Works, CS5 Errors

Post by Mike Hale »

Welcome to the forum. It has been a while since I created a Flex panel so this is just a guess.

CSXSInterface has to go through XML to communicate with the javascript file. I know some chars are a problem. Maybe the '|' char is one of those chars that don't work well with XML.
cameronmcefee

CS4 Works, CS5 Errors

Post by cameronmcefee »

Hi Mike,

Thanks for getting back to me. I didn't notice I wasn't subscribed to replies so I'm a little late getting back here.

I looked into what you suggested and tried just calling a very basic function, something equivalent to

Code: Select allfunction myFunction(){
  alert('foo')
}

Which gave me the same result. This is leading me to believe it not a problem with my functions themselves. Something to note which may be unrelated: When I first started I used trace() in the swf to track variables, which worked for a while. At some point it stopped functioning, and has yet to work for me. To get around it I wrote a trace() function in the jsx to do my own debugging, but since the above issue is happening it isn't accessible to me.

Since I've tried to execute methods that require no parameters and am still getting "some data expected" I'm thinking the methods are not the issue. Perhaps it's the SDK, CSXS library, or something elsewhere in my code. If you have any thoughts, please let me know. I'll just try to rebuild the environment for now and maybe create a duplicate project to see if I can sort this out.
cameronmcefee

CS4 Works, CS5 Errors

Post by cameronmcefee »

In scouring the Panel Developers Guide I found this:


Adobe® Photoshop® CS5

Brief notes for differences beetween CS4 and CS5. This guide is still referencing the CS4 documentation. It may or may not be up to date. More to come...

If you are using a JSX file for Photoshop DOM operations you must recompile with the CSXSLibrary-2.0.swc
LocalConnectionTarget and SocketTarget are no longer available. See Flex notes on using a logger and debugging your panel.
Panel's compiled with the 2.0 swc will continue to work in CS4.
All panels are now running in the AIR player engine, only one engine. This will impact any globals in the ActionScript code.
All panels using scripts are now running in one single ExtendScript engine. This will impact any globals in the ExtendScript code.
Alert.show("My string") will not work. Use Alert.show("My string", "My Title", Alert.OK, Sprite(mx.core.Application.application)) instead.
ArrayCollection is not getting stored correctly. Use Array instead.


It seems a bit counter intuitive to have a guide that back references outdated information with a single caveat in the intro, but it's what I've got to work with. I guess this problem is "solved."