Multiple Platform Release info

J. Landman Gay jacque at hyperactivesw.com
Tue Mar 26 13:27:00 EST 2002


Shari wrote:

> Saving as... into a separate file.  I don't use this option.  I want
> to "save as" as a new, separate file, not close my current file and
> end up working in the new file.

Put this script somewhere in the hierarchy (your Home stack, or a script
you have inserted, or in a stack put in use):

on saveStack
  put the filename of this stack into theOrigStack
  put the short name of this stack into theOrigName
  ask file "Save stack as:" with theOrigName
  if it = "" then exit saveStack
  put it into theNewStackName
  save this stack as theNewStackName
  if the result <> "" then
    answer "Unable to save stack."
  else
    set the itemDel to "/"
    set the name of this stack to last item of theNewStackName
    save this stack -- do it again, to set the short name
    delete this stack -- removes it from RAM
  end if
  go stack theOrigStack -- return to where you started
end saveStack

You can then call it from the message box to do incremental saves while
still remaining in the original stack.

> Also, I've stumbled over the memory issue, where Metacard/Revolution
> "retain" stacks in memory that are closed.  And then ask me questions
> later that I'm not certain how to answer.  I do not know what
> ramifications my answers will have as far as the current open project
> goes.

Remember that MC puts the whole stack into memory and identifies it by
its short name. If you try to open another stack with the same short
name, regardless of the filepath on disk, MC considers it a duplicate.
There cannot be two stacks open at the same time with the same short
name. If you click the Help button in the dialog MC presents when this
happens, you see in part:

"This dialog appears when you try to open a stack file that contains a
main stack with the same name as a main stack you have opened
previously.  This dialog gives you the choice of what to do with the
currently loaded main stack.  If you choose "Save", the current main
stack is saved, then purged from memory (see the destroyStack property)
and then the new stack is loaded into memory and opened.  If you choose
"Purge", the current main stack is purged from memory without saving and
then the new stack is loaded.  If you choose "Cancel", the loading of
the new stack is canceled and the already-resident main stack remains in memory."

So, whether you click "save" or "purge" just depends on whether you want
to save the currently-loaded stack before it closes. In either case, the
new stack you tried to open will be loaded -- unless you choose Cancel
in the dialog, which aborts the whole thing.

> So for me to "Save As"... I take the long road... I quit the program,
> copy the file, and relaunch.

Actually, the "long road" doesn't have to be quite that long. Since
stacks are completely in RAM, you only need to click over to the Finder,
drag off a duplicate, rename it, and go back to the stack you are
working on. No quit needed. I often do this when I realize that I've
made a lot of changes that I'm not sure will work. Even after all the
scripts have been altered, if I haven't saved the stack, the copy on
disk is still the original. I can drag off a duplicate at any time
before saving the stack I'm working in, and the duplicate will be my
original work, not the changed stuff. There can be some disadvantages to
the way MC loads a whole stack into RAM, but the opportunity to save a
stack in its original form even after making changes to it in the
development environment is one of the benefits.

Another way I've taken advantage of this RAM-based stack business is
when checking my stack across Mac and Windows platforms. I copy the
stack to the PC over the network and usually need to make changes to it
over there. Then I copy the stack back to the Mac, replacing the
original on disk (assuming there's a backup) even though the stack is
still open in MC on the Mac. When I want to see how my PC changes
affected the Mac version, I just type "revert" into the message box,
which causes MC to reload the stack from disk. Of course, the stack on
disk is the one with the changes I made on the PC -- and they
immediately show up in the copy of MC running on the Mac. I do this in
both directions. It is a very fast way to see changes on one machine
that you've made on another.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the metacard mailing list