# Creating Override Library via script

I've been trying for days to create a script for my addon that does the following things:

1. Open an existing file A.
3. Create an Override Library on this file.

The problem is that when you open the A file the context disappears and does not allow the command to run

bpy.ops.object.make_override_library

The error message is that the context is incorrect.

finally i've found the solution...

  for w in bpy.context.window_manager.windows:
if w.screen.name  == "Layout":
for area in w.screen.areas:
if area.type == 'VIEW_3D':
for region in area.regions:
if region.type == 'WINDOW':
override = bpy.context.copy()
override[ 'area'] = area
override['region'] = region
bpy.ops.object.make_override_library(override)
break