Running a script AFTER the blend has fully loaded

Hi,
I’m trying to do the following:
blender -b file.blend -P script.py

I need to know when file.blend is loaded, and everything is initialized inside blender.
I’m currently in the state where the keyframe data isn’t updated, and my script is getting wrong information by querying the data inside bpy.

I’m hoping there is something script.py can call, like:
bpy.utils.update()
to get everything initialized, but I haven’t found such a call…

Thanks,
Dave

Have you tried just leaving script.py in the BLEND file and setting it to “Register”?

If not, try putting a sleep at the start of your script, perhaps that will give enough time for Blender to be up and running before your script starts processing against the BPY data.