# Video Sequence Editor - Insert a video strip between other strips using python like GG or Alt+G

As stated in the title. If I grab a strip with "G" then press "G" again then drag the strip to where I want it (over top of other strip), then when I drop it, it will be inserted between the strips where I drop it and all strips to the right will be moved down to make room for the dropped strip.

I want to be able to do this in python.

I tried things like the following but it didn't work:

bpy.ops.transform.transform(override, mode='SEQSLIDE', value=(0,-1,0,0),snap=True, snap_target='CLOSEST')

bpy.ops.transform.transform(override, mode='TRANSLATION', value=(0,-1,0,0))

bpy.ops.transform.seq_slide(override, value=(0,-1),snap=True, snap_target='CLOSEST')


Etc.

Note, I did the -1 in the Y axis because when I duplicate the strip in python, it gets placed one channel higher because there is no room in the current channel. What I want to do is get the active strip (a new strip) and move it in-between other strips at the x position I specify and shuffle all other strips down to make room for it like the GG or Alt+G shortcuts do.

How do I do this in python?

Also as a side question, how can I create a new Text Strip in the video sequence editor in python.

Thanks

• note that override is override = {'window': bpy.context.window, 'screen': screen, 'area': area, 'region': region} and it's a way to find the video sequence editor without being in that window. I'm running this script through the text editor. The override is working as the strips get inserted, just not where I want. I also get warnings about PyContext 'scene' not found and 'edit_object', 'gpencil_data' not found etc. Is there a way to specify the override without these messages printed to the console/terminal? – Coder Mar 12 '17 at 12:29