       if not @assSections[layerNum][prefix]?
         @assSections[layerNum][prefix] = []
 
-      @assSections[layerNum][prefix].push ASS_createDrawingFromPoints path.pathPoints
+      Array.prototype.push.apply @assSections[layerNum][prefix], ASS_createDrawingFromPoints path.pathPoints
 
     prefix: (stroke, fill) -> "{\\an7\\pos(0,0)#{stroke}#{fill}\\p1}"
 


  alert "Your colorspace needs to be RGB if you want colors." if doc.documentColorSpace == DocumentColorSpace.CMYK

  # For ASS, the origin is the top-left corner
  ASS_fixCoords = ( coordArr ) ->
    coordArr[0] = Math.round( (coordArr[0] + org[0])*100 )/100
    coordArr[1] = Math.round( (doc.height - (org[1] + coordArr[1]))*100 )/100
    coordArr.join " "

  checkLinear = ( currPoint, prevPoint ) ->
    p1 = (prevPoint.anchor[0] == prevPoint.rightDirection[0] && prevPoint.anchor[1] == prevPoint.rightDirection[1])
    p2 = (currPoint.anchor[0] == currPoint.leftDirection[0] && currPoint.anchor[1] == currPoint.leftDirection[1])
    (p1 && p2)

  ASS_linear = ( currPoint ) ->
    drawing = ""

    if drawCom != 1
      drawCom = 1
      drawing = "l "

    drawing += "#{ASS_fixCoords currPoint.anchor} "

  ASS_cubic = ( currPoint, prevPoint ) ->
    drawing = ""

    if drawCom != 2
      drawCom = 2
      drawing = "b "

    drawing += "#{ASS_fixCoords prevPoint.rightDirection} #{ASS_fixCoords currPoint.leftDirection} #{ASS_fixCoords currPoint.anchor} "

  zeroPad = ( num ) ->
    if num < 16

    # "SpotColor"

  ASS_createDrawingFromPoints = ( pathPoints ) ->
    drawing.new()

    if pathPoints.length > 0
      drawing.addMove pathPoints[0]

      for j in [1...pathPoints.length] by 1
        currPoint = pathPoints[j]
        prevPoint = pathPoints[j-1]

        if checkLinear currPoint, prevPoint
          drawing.addLinear currPoint
        else
          drawing.addCubic currPoint, prevPoint

      prevPoint = pathPoints[pathPoints.length-1]
      currPoint = pathPoints[0]

      if checkLinear currPoint, prevPoint
        drawing.addLinear currPoint
      else
        drawing.addCubic currPoint, prevPoint

      return drawing.get()

  allThePaths = []
  recursePageItem = ( pageItem ) ->
