I' ve written the following function to apply a shrinkwrap modifier
def shrinkwrap(obs):
for ob in obs:
if not ob.type == 'MESH':
continue
msw = ob.modifiers.new("shrink", type = 'SHRINKWRAP')
bpy.data.objects["body_2"].modifiers["shrink"].target = bpy.data.objects["body_1"]
bpy.ops.object.modifier_apply(apply_as = 'DATA')
I've problems with the last row (it is the function that should let me push the apply button shown in the following image )
In this image the target has not been selected, the function selects it correctly.