Recursively collect all linked files / assets

Hi!

I am wondering if there is a method or addon to copy all linked textures / libraries to a seperate folder. Like packing / saving / unpacking but automatically, and not only packing the linked libraries but in turn also packing everything the libraries have referenced, the complete project structure.

so something like:
[TABLE=“class: grid, width: 500”]

main blend
<–libraries
<-- more libraries
<-- textures for libs

<–textures

[/TABLE]

Thanks!

What happens if you run Object>Make Local…>All or (bpy.ops.object.make_local(type=‘ALL’) in code)? Doesn’t that work?