Skip to main content
raphaelmatto14
Inspiring
February 22, 2016
Answered

Is scripting multiple undo a bad idea?

  • February 22, 2016
  • 1 reply
  • 648 views

Hi Premiere api peeps,

I'm wondering how safe it is to undo an arbitrary number of times via jsx. I have this code:

for (var i = 0; i < numTransitionsRemoved; i++) {
    project.undo();
}

... in a larger script that in total removes all transitions, writes out a fcpxml file, then restores the transitions. I'm doing this because the fcpxml file won't have timecode in/out info unless the transitions are removed. The Premiere project can have lots of transitions. Probably not more than a few hundred, but possibly a thousand or more. I don't see an undo limit in Premiere prefs that would put a cap on the number of undos, but I'm guessing there may be an issue here with memory? Could you folks comment generally on what might go wrong? This seems to work in my tests with lots of transitions (a hundred or so), but I'm hesitant to send this code to my client w/o checking with you guys b/c it's not ideal. I also noticed there's an "undo_stack" method in there. How do I use that method? Could I potentially pinpoint a place in the undo stack with a single command, like:

project.undo_stack(numTransitionsRemoved)

?

Cheers,

Raphael

This topic has been closed for replies.
Correct answer Bruce Bullis

undo is only available from QE DOM projects, and is unsupported.

1 reply

Bruce Bullis
Bruce BullisCorrect answer
Legend
February 23, 2016

undo is only available from QE DOM projects, and is unsupported.

raphaelmatto14
Inspiring
February 23, 2016

Hi bbb_999,

Roger that. Could you pass usage info for the undo_stack method anyway? Would be appreciated

Cheers,

Raphael

raphaelmatto14
Inspiring
February 23, 2016

Oh, nevermind, thanks!