Create a new stack from an existing stack

35 views
Skip to first unread message

andre.tremblay

unread,
Aug 2, 2018, 4:25:46 PM8/2/18
to SuperCard Discussion
Hello, 

It is most likely a newbie question, but I haven't dealt with this kind of basic scripting for decades. 

I am trying to emulate the behaviour of HyperTalk script : 

create stack <NewName> with background <backgroundName>

This would create a new empty copy of the stack opened during this call with a copy of the background and its script. 

I can't see how to emulate this with 

new project <NewName>

Otherwise, if it can't be done, how can I create the individual objects, resize, rename and position them? 

As an exercice here is what I found from the documentation:

After creating the new project

set the windowSize of window 1 to 420,250

set the resizable of window 1 to false

set the script of window 1 to <ScriptVariable>

set the  name of window 1 to <NewWindowName>

Next, I would need to toggle to “BackGround” state:

domenu "BackGround"

How can I be sure it is in  “BackGround” state as it toggles at each call?

Next create a field :

new fld 

set the name of bg fld 1 to "Test"

set the rect of fld "Test" to 5,5,415,235

set the lockText of fld "test" to true 

Anyone have suggestions to improve this process? Or comments?

Thank you

André Tremblay
PhotoGraphex

Scott

unread,
Aug 2, 2018, 5:08:00 PM8/2/18
to superca...@googlegroups.com
If it is just a simple one window project with one background I would suggest something like:

get the windowsize of this wd
copy card
new project "thenewproj.sc45"
paste card
lock screen
go card
1
delete card
set the windowsize of this wd to it


The background will be copied with the card. Then just repeat through the fields and put empty into them.

John Johnston

unread,
Aug 2, 2018, 5:22:17 PM8/2/18
to superca...@googlegroups.com
Hi André,

A different way to tackle this is to create a template project.

Then read that project as a file and put it in a userProp.

You can then write a new project out whenever you want.

I attach a rather old example. It seems to work,

Cheers

John


Store Doc.zip
signature.asc

andre.tremblay

unread,
Aug 2, 2018, 6:10:18 PM8/2/18
to SuperCard Discussion
Thank Mark and John, 

There is a lot of inspiration to draw from those two examples. I can go along with these. 

I forgot to ask, is it possible to create a New Project to a specific location directly or it need to be created and move afterward?

Regards

André Tremblay
PhotoGraphex
Reply all
Reply to author
Forward
0 new messages