0 Replies Latest reply on Sep 13, 2012 9:05 AM by mmmmins

    New Layer Via Copy from Extension

    mmmmins

      Hello everybody,

       

      I'm trying to create a new layer using the Layer > New > Layer Via Copy functionality... and I did scan the code using the Scripting Plug-in with this result:

       

      var idCpTL = charIDToTypeID( "CpTL" );

      executeAction( idCpTL, undefined, DialogModes.NO );

       

      Then I did convert it to:

       

      var application:com.adobe.photoshop.Application = Photoshop.app;

      var idCpTL:Number = application.charIDToTypeID( "CpTL" );

      application.executeAction( idCpTL, undefined, DialogModes.NO );

       

      But this code raises this exception:

       

      Error: NULL pointer was encountered

                at flash.external::HostObject/__call()

                at com.adobe.csawlib::CSHostObject/hostCall()

                at com.adobe.photoshop::Application/executeAction()

       

      I've tried to change "undefined" for "null" or any other idea... but with no luck. What am I doing wrong here?

       

      Thanks a lot!