Cloning a stack and renaming it.

David Epstein depstein at att.net
Sat Jan 18 15:52:01 EST 2003


An update on the two questions below:


1.  I noticed that the Revolution documentation says that "By default, the
mainStack property of newly created stacks is set to the new stack itself."
This seems accurate, so unless I'm missing something the Metacard 2.4.3
reference stack needs correcting

2.  The script I posted yesterday works today, so I hope no one is still
trying to figure out what's wrong with it.  But this happens to me
occasionally:  something that should work doesn't work, and later it works,
typically after I've quit and relaunched Metacard.  Any interpretations of
this?

Many thanks.

David Epstein

Original message:

> From: David Epstein <depstein at att.net>
> To: <metacard at lists.runrev.com>
> Reply-To: metacard at lists.runrev.com
> 
> 1.  The Metacard 2.4.3 reference stack entry for "mainStack" says that
> "stacks created with the create or clone commands become substacks of the
> topStack."  Is this true?  The clone becomes the top stack.  I don't see it
> listed among the substacks of the (previous) top stack, and when I check its
> own properties the "Main Stack..." button shows it as its own main stack.
> And when use the Metacard "Save" command the dialog seems to be trying to
> save it as its own stack.  I am happy with this behavior and wouldn't really
> want it to be a substack, but am wondering if I misunderstand the reference
> stack.
> 
> 2.  I don't know if the following problem is related to #1 or not, but can
> somebody see what I'm doing wrong?  I want to clone a stack that is a
> substack of the current top stack, let the user choose a name and path, and
> then save the clone under that name at that path.  My script:
> 
> ask file "Name for the new file?" with "Untitled"
> put it into longName
> set itemDelimiter to "/"
> put last item of longName into shortName
> clone stack "ATCMO" -- my model stack, which is a substack of the top
> stack
> set the name of it to shortName -- ** SEE NOTE BELOW
> save stack shortName as longName
> 
> ** This is the line that's not working as I expect.  My model stack gets
> cloned, with "Copy of ATCMO" in the title bar.  But the next line does not
> manage to change its name, and so the last line can't save a stack that
> doesn't exist.
> 
> Many thanks.
> 
> David Epstein




More information about the metacard mailing list