10 Replies Latest reply on Feb 5, 2013 1:33 PM by Radsvid789

    Problems with selection.fill/pathItem.fillPath -- Ps CS6, JSX, Windows

    Radsvid789

      Hi all,

       

      First post here

       

      I've started lately to play around with extended javascript (jsx) scripting on Photoshop CS6 (using 32-bit version on Windows 7 Ultimate).

       

      I've had much trouble with 'fill' commands.

       

      This one here gives me an

       

      Error 1200: Internal error

      Line: 5

      ->  app.activeDocument.selection.fill( myColor );

      var myColor = new SolidColor();
      
      app.documents.add( 100, 100, 72, "tmp", NewDocumentMode.RGB, DocumentFill.TRANSPARENT );
      app.activeDocument.selection.selectAll();
      app.activeDocument.selection.fill( myColor );
      

      I read somewhere that giving all the parameters to the fill method could solve it, but it gave me the same result.

       

      I've also tried the fillPath method from PathItem, but it gave also an internal error (1200).

       

      var myColor = new SolidColor();

       

      var docRef = app.documents.add(500, 700, 72, "Simple Line")

       

      var lineArray = new Array()

      lineArray[0] = new PathPointInfo

      lineArray[0].kind = PointKind.CORNERPOINT

      lineArray[0].anchor = Array(100, 100)

      lineArray[0].leftDirection = lineArray[0].anchor

      lineArray[0].rightDirection = lineArray[0].anchor

      lineArray[1] = new PathPointInfo

      lineArray[1].kind = PointKind.CORNERPOINT

      lineArray[1].anchor = Array(150, 200)

      lineArray[1].leftDirection = lineArray[1].anchor

      lineArray[1].rightDirection = lineArray[1].anchor

      lineArray[2] = new PathPointInfo

      lineArray[2].kind = PointKind.CORNERPOINT

      lineArray[2].anchor = Array(100, 200)

      lineArray[2].leftDirection = lineArray[2].anchor

      lineArray[2].rightDirection = lineArray[2].anchor

      var lineSubPathArray = new Array()

      lineSubPathArray[0] = new SubPathInfo()

      lineSubPathArray[0].operation = ShapeOperation.SHAPEXOR

      lineSubPathArray[0].closed = true

      lineSubPathArray[0].entireSubPath = lineArray

       

      var myPathItem = docRef.pathItems.add("A Line", lineSubPathArray)

      myPathItem.fillPath(myColor, ColorBlendMode.NORMAL, 100, true, 0.0, true, true)

       

      This example only works if there is not parameters at all given to fillPath (it's filling with black).

       

      Does anyone know how I could work around this? Is it a known bug?

       

      Thanks all!