Don't work evalscript!

General Discussion of Scripting for Flex, Flash & CS SDK

Moderators: xbytor, DavideBarranca, Paul MR

Artlover

Don't work evalscript!

Postby Artlover » Mon Nov 25, 2013 9:40 pm

I have Extension Builder 3.4 and mac

MXML File:
Code: Select all
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="300" height="500"
            historyManagementEnabled="false" horizontalScrollPolicy="off" layout="absolute"    verticalScrollPolicy="off">
   <mx:Script>
      <![CDATA[
         import com.adobe.csawlib.photoshop.Photoshop;
         import com.adobe.photoshop.*;

   <mx:Button x="10" y="425" width="278" height="45" label="Generate" click="SPhotoshop.run()" cornerRadius="2" enabled="{hostName.indexOf('SPhotoshop') &gt; -1}" labelPlacement="left"/>
</mx:Application>


AS3 File:
Code: Select all
package
{
   import com.adobe.csawlib.photoshop.Photoshop;
   import com.adobe.csxs.core.CSXSInterface;
   import com.adobe.csxs.events.*;
   import com.adobe.csxs.types.*;
   import com.adobe.photoshop.*;
   
   public class SPhotoshop
   {   
      public static function run():void
      {
         var app:Application = Photoshop.app;
         var docRef:Document = app.activeDocument;
         CSXSInterface.instance.evalScript("sayHello");
   }
}


JS File:
Code: Select all
function sayHello () {
try{alert("Hello");}
catch (e){}
}


Thanks in advance!



Return to “Flex, Flash & CS SDK: General Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest