rows = arcpy.SearchCursor(mLayer, "WoodyAreasClip.ProtectedStatus = " + repr(theStatus)) for row in rows: theOID = row.getValue(r"WoodyAreasClip.OBJECTID") arcpy.SelectLayerByAttribute_management(mLayer, "NEW_SELECTION", "WoodyAreasClip.OBJECTID = " + repr(theOID)) DF.zoomToSelectedFeatures() arcpy.RefreshActiveView() # print it (or export it) arcpy.mapping.ExportToJPEG(MXD, r"C:\temp" + "\\" + repr(theOID) + ".jpg")