Note to self: ALWAYS apply script changes

Ron Noice ron at ecionmicroed.com
Mon Jun 27 17:38:42 EDT 2005


I've run into a problem in 2.6 that caused me to lose everything since the previous save. Twice! Which just goes to show ya -- it takes repetition to teach an old dog new tricks. Very likely I'm the only twit who would actually follow the sequence of events I'll outline here, but just in case someone else does, don't! The end result is that I get myself into a position where I try to Save but instead, Rev immediately quits without saving anything. Don't know if this can be classed as a bug or just as something stupid not to do. But the problem can be reproduced with the following clever steps (BTW, I'm using Windows XP - which should have been punishment enough - and Rev 2.6):

1. Open a stack or start a new one.
2. Make some changes -- insert new objects, move objects around, etc.
3. Create a new button.
4. Open the script editor for that button and put something into it.
5. But now, you're thinking "I wonder if ..." and you think you'll take a look at something else in the stack behind the script editor. So you move the script editor out of the way. Note that the script has not been Applied because you're not finished with it yet. <-- BIG MISTAKE
6. You look at the "something else" in your stack and then realize you don't need that new button after all. So you delete the button (yeah -- its script is still open!)
7. Better save, right? So press Ctrl+S to save and thus the trouble begins. 

At this point, a message opens in your unapplied script window: "The object you are editing appears to have been removed or deleted. Do you want to copy the text you are editing to the clipboard before closing this script?" along with a "Close" button and a "Copy and close" button. (A "Cancel" button would have been soooo nice!) So you click one of the buttons and then, to your amazement, everything disappears -- i.e., Rev quits and you lose all the changes you've made.

Once I stopped pounding my head on the desk, I played around with this a bit and found that these seem to be the triggers that cause the problem:
a) Using 2.6 is a trigger -- in 2.5.1, the Save dialogue appears FIRST to let you save and the error only appears when you quit so there is no calamity.
b) Using Ctrl+S is a trigger -- if I use File | Save instead, the Save dialogue appears and lets you save.
c) Not applying script changes is a definite trigger -- if I Apply first, deleting the button has no severe effect even if its script is still open. I can even use Ctrl+S in this case and the stack will still save after the error message has been dismissed.

So the moral of this story, class, is to ALWAYS APPLY SCRIPT CHANGES before looking at something else even if you are not finished with the script.

... Ron




More information about the use-livecode mailing list