I am trying to select all objects with a custom property with a given value but with no success. The custom property is "category" and the value is "Windows". This is what I have tried. Any ideas?
for obj in bpy.context.visible_objects:
if bpy.data.objects[str(obj.name)]["category"]=="Windows":
obj.select_set(True)
There might also be variants of "Windows" so wildcards would be useful.