Multiple objects with quadToTriangle

hi i want to triangulate multiple objects with a python script my problem is that iam not a real coder. i found this piece of code:

def quadToTri (object,scene):
 object.sel=1
 Blender.Object.Duplicate(mesh=1)
 ob2=Blender.Object.GetSelected()[0]
 m2=ob2.getData(mesh=1)
 for f in m2.faces:
  f.sel=1
 m2.quadToTriangle()
 #scn.unlink(ob2)
 return ob2

it seams to me that i can select multiple objects “ob2=Blender.Object.GetSelected()[0]” and than “for f in m2.faces: f.sel=1” goes thru all faces and “m2.quadToTriangle()” triangulets them. when i run this script nothing happens and no error, and the objects are still not triangulatet.

thanks