Quote:
Originally Posted by lexaproductions
Hi guys,
I have Script A which changes the pitch of items and save the amount in a ProjExtState
Then Script B Shows that ProjExtState in a GUI.
It works great but the problem is if I undo Script A, then the ProjExtState is not undone which leads to Script B not showing the right value.
How can I include my ProjExtState change in the undo cycle? It's already in the undo loop in my code.
|
Script A is a deferred script? How do you undo? Using Reaper's undo (CTRL+Z) or an undo button in your script?
You could save the previous value along with the new one in Script A and add an Undo button on your Script B that resets to the previous value. It's up to you how many undo states you want to save.
Code:
pseudocode for 3 undos for example
Script A
if undoextstate2 then undoextstate3 = undoextstate2 end
if undoextstate1 then undoextstate2 = undoextstate1 end
current_value = undoexstate1
set current_value