           recursePageItem pageItem
 
       @common( )
+      return output.get()
 
     giveMeASeizure: ->
-      output.merge = ->
-        @append "\n"
 
       pWin.label = pWin.add "statictext", undefined, ""
 
       for layer in doc.layers
-        currLayer = layer
-        pWin.label.text = "Layer: #{currLayer.name}"
-
-        if currLayer.pageItems.length isnt 0 and currLayer.visible
-          @collectActiveLayer( )
-        else if currLayer.pageItems.length is 0
-          output.append "\n"
-
-      output.str
+        pWin.label.text = "Layer: #{layer.name}"
+
+        for pageItem in layer.pageItems
+          recursePageItem pageItem
+
+      @common( )
+      return output.get()
   }
 
   methods[options.method]( )


  methods = {
    common: ->

      pWin.show( )

      output.init( allThePaths[0] )

      for path, i in allThePaths
        output.appendPath path
        pWin.pBar.value = Math.ceil i*250/(allThePaths.length-1)
        pWin.update( )

      output.splitClean( )
      output.append output.suffix( )
      pWin.close( )
      allThePaths = []
      output.merge( )

    collectActiveLayer: ->


  drawCom = 0

  output = {
    assSections: []

    appendPath: ( path ) ->
      stroke = manageColor path, "strokeColor", 3
      fill = manageColor path, "fillColor", 1
      layerName = path.layer.name
      layerNum = path.layer.zOrderPosition

      prefix = @prefix stroke, fill, layerNum, layerName

      if not @assSections[layerNum]?
        @assSections[layerNum] = {}

      if not @assSections[layerNum][prefix]?
        @assSections[layerNum][prefix] = []

      @assSections[layerNum][prefix].push ASS_createDrawingFromPoints path.pathPoints

    prefix: (stroke, fill) -> "{\\an7\\pos(0,0)#{stroke}#{fill}\\p1}"

    suffix: -> "{\\p0}"

    get: (includeEmptyLayers = false) ->
      fragments = []
      suffix = @suffix()

      for shapes, layerNum in @assSections
        if shapes?
          for prefix, paths of shapes
            fragments.push prefix
            fragments.push.apply fragments, paths
            fragments.push suffix
            fragments.push "\n"
        else if includeEmptyLayers
            fragments.push "\n"

      fragments.pop()
      return fragments.join ""
  }

  switch options.wrapper
