i am pretty sure you are getting that error because you are trying to save layer when in fact the object you have at the point is not a layer - but is in fact a layer within a group layer. You need to be saving the group layer the below change might work......... #This comparison test for layers in a group layer vs those not in. The .longName property includes all group layers as part of path if singlelayer.name != singlelayer.longName: outputFile.write(pathfull + "\t" + singlelayer.longName + "\t" + singlelayer.name + "\t" + dataSourceOrig + "\t" + dataSourceNew + "\t" + "GROUP LAYER SOURCE" "\n") singlelayer.findAndReplaceWorkspacePath(sourceString, replacementString, True) print "%s group source changed" % singlelayer #singlelayer.save() layer.save() print "%s saved" % singlelayer
... View more