     visibleCells.put translatedCell, state
   return exportField visibleCells
 
-showExporDialog = (sdata) ->
+showExportDialog = (sdata) ->
   E('export').value = sdata
   E('export-dialog').style.display = ''
   E('export').focus()
   E('export').select()
   
 doExportVisible = ->
-  showExporDialog stringifyFieldData encodeVisible()
+  n = application.getGroup().n
+  m = application.getGroup().m
+  data = stringifyFieldData encodeVisible()
+  showExportDialog "#{n}$#{m}$#{data}"
   
 doShowImport = ->
   E('import-dialog').style.display = ''

updatePlayButtons()
redrawLoop()

application.saveDialog.show()

  importData: (data)->
    try
      console.log "importing #{data}"
      match = data.match /^(\d+)\$(\d+)\$(.*)$/
      throw new Error("Data format unrecognized") unless match?
      n = parseIntChecked match[1]
      m = parseIntChecked match[2]

      if n isnt @getGroup().n or m isnt @getGroup().m
        console.log "Need to change grid"
        @setGridImpl n, m
      @cells = importField parseFieldData match[3]
      console.log "Imported #{@cells.count} cells"
    catch e
      alert "Faield to import data: #{e}"
