I am trying to export all active layers in a QGIS project to a specified folder, below is what I get atm
Outputdir='C:/Users/DN/Downloads/Test/'
layer = iface.activeLayer()
QgsVectorFileWriter.writeAsVectorFormat( layer, Outputdir + layer.name() + ".shp", "utf-8", layer.crs(), "ESRI Shapefile", 1)
It only works when I click on the layer that I want to export, I am wondering if it's possible to write a loop to loop through all active layers in the project and export them.