Below is the code that is for flipping the vertex on an object. I want it so I can select all objects and run the script it does it to all the objects selected instead of doing them individually. If someone could edit it or tell me how to fix it that would be greatly appreciated.
import bpy
obj = bpy.context.active_object
for ipoly in range(len(obj.data.polygons)):
for idx, ivertex in enumerate(obj.data.polygons[ipoly].loop_indices):
ivert = obj.data.polygons[ipoly].vertices[idx]
col = obj.data.vertex_colors.active.data[ivertex].color
obj.data.vertex_colors.active.data[ivertex].color = tuple(1-x for x in col)