Page 1 of 1
second instance of a stack
Posted: Sat Mar 01, 2008 4:32 pm
by Preston Shea
how do you say
on mouseUp
open a copy of this stack in a new window and go to card XYZ of the newly opened stack
end mouseUp
Posted: Sat Mar 01, 2008 5:14 pm
by Mark
Hi Preston,
Code: Select all
on mouseUp
put the mainstack of this stack into myMainStack
clone this stack
put it into myNewStack
set the mainstack of myNewStack to myMainstack -- optional
go cd "XYZ" of myNewStack
end mouseUp
Untested, but should work.
Best,
Mark
Posted: Sat Mar 01, 2008 5:57 pm
by mcgrath3
Be careful as clone makes an exact copy with the same name as the original and this could cause some confusion in the message path. So if you do make a clone the first thing to do is rename the stack.
Posted: Sat Mar 01, 2008 6:02 pm
by Preston Shea
Mark wrote:Hi Preston,
Code: Select all
on mouseUp
put the mainstack of this stack into myMainStack
clone this stack
put it into myNewStack
set the mainstack of myNewStack to myMainstack -- optional
go cd "XYZ" of myNewStack
end mouseUp
Untested, but should work.
Best,
Thanks so much! You are a prince among men. I had to add "stack"
on mouseUp
put the mainstack of this stack into myMainStack
clone this stack
put it into myNewStack
set the mainstack of myNewStack to myMainstack -- optional
go cd "XYZ" of
stack myNewStack
end mouseUp
Mark
Posted: Sat Mar 01, 2008 6:20 pm
by Mark
mcgrath3 wrote:Be careful as clone makes an exact copy with the same name as the original and this could cause some confusion in the message path. So if you do make a clone the first thing to do is rename the stack.
This is not true.
Best,
Mark
Posted: Sat Mar 01, 2008 8:32 pm
by Preston Shea
I have gotten the "stack with same name" message but no when running the stack as a standalone, which is my goal.
Posted: Sat Mar 01, 2008 8:37 pm
by Mark
Hi Preston,
You get the error message because you do have a stack with that name already, perhaps because you clone twice.
In a standalone, error messages don't appear by default, but they do occur and you should not ignore them.
Best,
Mark
Posted: Thu May 01, 2008 7:15 pm
by ThinKolistic
mcgrath3 wrote:Be careful as clone makes an exact copy with the same name as the original and this could cause some confusion in the message path. So if you do make a clone the first thing to do is rename the stack.
I just made a copy of a file in the Mac finder, rather than rely on my 99.95% memory

"copy" was appended to the duplicate, automatically.
Would that kind of concept help prevent confusion ? Would all the cards need name changes ?
Posted: Fri May 02, 2008 4:45 am
by mcgrath3
No once the stack is renamed then each card can retain the same name. This is because the actual card is named: card "MyName" of stack "MyStack" ---- and ---- card "MyName" of stack "MyStackRenamed"
I usually use the whole name like this to avoid any issues with same name cards etc.
The same is true for objects: btn "MyButton" of card "MyName" of stack "MyStack" is different than btn "MyButton" of card "MyName" of stack "MyStackRenamed"
In a cloned stack there are now two stacks with the same scripts running that are calling items that are named the same and if you only write things like - send mouseUp to btn "MyButton" in 5 - then it could send this message to either btn "MyButton" when it comes down the object path.
It is just cleaner to use the whole object path to avoid these things.
Also, if you choose to change 'ALL' names in a stack then close the one stack and do a find/replace on the other stack for each name you want to change. find "MyButton" replace "MyButtonTwo"
HTH
Tom McGrath