I, too, have had issues in the past using the mesh select_all
operator from within Edit mode. As an alternative, try looping through all of the vertices and setting their select
property to True
. Then, switch into Edit mode before doing the Remove Doubles operator. Your code should look something like this:
for obj in bpy.data.objects:
if obj.name[0:4] == "Text" and obj.type == "MESH":
bpy.context.scene.objects.active = obj
for vert in obj.vertices:
vert.select = True
bpy.ops.object.mode_set(mode = 'EDIT')
bpy.ops.mesh.remove_doubles(0.0001)
bpy.ops.object.mode_set(mode = 'OBJECT')