How to switch to "active" after append? When I try to use bpy.ops.wm.append, the object appears &quot;selected&quot; with the red outline, but how do I switch it to &quot;Active&quot; with yellow outline?
bpy.ops.wm.append(
    filepath=&quot;Prefab_Objects.blend&quot;,
    directory=&quot;/Users/Yuri/Desktop/Blender_Python_Test/Prefab_Objects.blend\\Object\\&quot;,
    filename=&quot;tower&quot;)

(I need to apply bpy.context.active_object.name afterward, but can’t because the object is not &quot;active&quot;)
You can set the active object with this command:
If len(bpy.context.selected_objects):
    bpy.context.view_layer.objects.active = bpy.context.selected_objects[0]

The active object is now reachable by:
active_obj = bpy.context.active_object