I am trying to save all the layers in Layers panel as MapInfo TAB file Then closed them all. But, Save as part doesn't work. There is no error but it doesn't save it. When I change the format to another format like "ESRI Shapefile" the code works well.
def packTables(): from qgis.core import * from PyQt4.QtCore import * import os.path gda94CRS=QgsCoordinateReferenceSystem("EPSG:38356") for layer in iface.mapCanvas().layers(): layerName=layer.name() layerCRS=layer.crs() layerSource=layer.source() destination="D:/1" + "/"+layerName QgsVectorFileWriter.writeAsVectorFormat(layer, destination ,'System', gda94CRS,"Mapinfo TAB") QgsMapLayerRegistry.instance().removeMapLayer(layer) packTables()