There's a pesky pothole you can fall into on the Embedded Script Files
subtab of the Scripting tab of the Document Properties dialog. You
click the plus sign, a script ID appears in the Script ID list, so you
say "good, now I'll type in all the functions into the Content field."
Bzzzt, you've just lost time, and without just the right moves it will
be all the time you spent typing into that little, unenlargeable
Content field. You had forgotten to highlight the script ID, and the
second you do, all your functions vanish. Or, if you save and go on to
other things, you lose all your functions.
ALWAYS make sure you highlight the script ID BEFORE typing into the
Better yet, type your functions in an editor, where you have all the
room you need and all your familiar editing facilities. Then, click the
plus sign, highlight the new script ID, and then copy your functions
from your editor and paste them into the little Content field.
If you ever notice that you've typed functions into the content field
without highlighting the script ID, copy all your work out of the
content field, paste it into an editor, highlight the script ID, and
then copy from the editor and paste back into the content field.