Open a LC document using a standalone
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Open a LC document using a standalone
Hi Max,
from your last mail I think we have a VERY BIG misunderstanding here!
1. You can NOT make a copy of the stack that has been turned into a standalone!
2. We are talking about separate files.
3. We are talking about the so called "splash" screen technique.
4. Yes -> put url("binfile:...) into url ("binfile:...) will make a copy of a file.
Example:
You have a stack MYSTACK that you want to make a standalone from but also want to make that stack editable.
Then you do NOT create a standalone from that stack but rather create an extra stack e.g. "splash", which will only be turned into the standalone and open stack MYSTACK.
Now create a standalone from stack "splash" and add the stack MYSTACK to the standalone via the "Copy files" tab as explained earlier. THEN you can use my script to copy stack "MYSTACK to the users docs folder if neccessary, because we have your stack as a separate file in the app bundle and can be copied to the users doc folder.
Capisce?
Best
Klaus
from your last mail I think we have a VERY BIG misunderstanding here!
1. You can NOT make a copy of the stack that has been turned into a standalone!
2. We are talking about separate files.
3. We are talking about the so called "splash" screen technique.
4. Yes -> put url("binfile:...) into url ("binfile:...) will make a copy of a file.
Example:
You have a stack MYSTACK that you want to make a standalone from but also want to make that stack editable.
Then you do NOT create a standalone from that stack but rather create an extra stack e.g. "splash", which will only be turned into the standalone and open stack MYSTACK.
Now create a standalone from stack "splash" and add the stack MYSTACK to the standalone via the "Copy files" tab as explained earlier. THEN you can use my script to copy stack "MYSTACK to the users docs folder if neccessary, because we have your stack as a separate file in the app bundle and can be copied to the users doc folder.
Capisce?
Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 9804
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Open a LC document using a standalone
Brian's post is well worth a second read:
viewtopic.php?f=9&t=30817&start=15#p166830
viewtopic.php?f=9&t=30817&start=15#p166830
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Open a LC document using a standalone
Klaus,
You were very clear the first time. I understood exactly what you were saying. I did exactly as you suggested.
The error seems to be with
put url("binfile:...) into url ("binfile:...)
It makes a file with the correct name in the correct place, but is completely empty.
I am not sure why this is not copying correctly.
Because of you help, I am now actually optimisic about getting this to work. I'll try again with version 9 of livecode.
Max
You were very clear the first time. I understood exactly what you were saying. I did exactly as you suggested.
The error seems to be with
put url("binfile:...) into url ("binfile:...)
It makes a file with the correct name in the correct place, but is completely empty.
I am not sure why this is not copying correctly.
Because of you help, I am now actually optimisic about getting this to work. I'll try again with version 9 of livecode.
Max
-
- VIP Livecode Opensource Backer
- Posts: 9804
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Open a LC document using a standalone
That's where the sysError function comes in.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Open a LC document using a standalone
Hi Richard,
I used the sysError function . It returned only the number "2".
Bathroom humor?
Here is the file attached
I used the sysError function . It returned only the number "2".
Bathroom humor?
Here is the file attached
- Attachments
-
- testb.livecode.zip
- (949 Bytes) Downloaded 279 times
-
- testa.livecode.zip
- (1.92 KiB) Downloaded 256 times
-
- VIP Livecode Opensource Backer
- Posts: 9804
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Open a LC document using a standalone
You can find error codes for each OS online. For most, Error 2 is an invalid path to a file.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Open a LC document using a standalone
Hi Max,
I did not tell you to create a stack named "testb.livecode" and add it to your standalone!
You don't need it here at all!
I meant that you have to copy the stack inside of the app package "testa.livecode" and copy it to the users douments folder to a file named the same "testa.livecode".
But that is not the problem here! The pathnames are definitively OK, I'm out of ideas in the moment...
Best
Klaus
not completely!
I did not tell you to create a stack named "testb.livecode" and add it to your standalone!
You don't need it here at all!
I meant that you have to copy the stack inside of the app package "testa.livecode" and copy it to the users douments folder to a file named the same "testa.livecode".
But that is not the problem here! The pathnames are definitively OK, I'm out of ideas in the moment...
Best
Klaus
Re: Open a LC document using a standalone
Hi Klaus,
Please forgive me. I must be dense.
I have read the sentence below many many times, and I just do not understand what this means. Perhaps that is why things are not working,
--
"I meant that you have to copy the stack inside of the app package "testa.livecode" and copy it to the users douments folder to a file named the same "testa.livecode"."
Stack Testa is and empty splash screen app that opens stack testb, which has all my data. Stack testb will open when I click on stack test A. I just cant get the "bin" code to make a copy of the stack.
I completely understand if you want to give up helping me. Max
Please forgive me. I must be dense.
I have read the sentence below many many times, and I just do not understand what this means. Perhaps that is why things are not working,
--
"I meant that you have to copy the stack inside of the app package "testa.livecode" and copy it to the users douments folder to a file named the same "testa.livecode"."
Stack Testa is and empty splash screen app that opens stack testb, which has all my data. Stack testb will open when I click on stack test A. I just cant get the "bin" code to make a copy of the stack.
I completely understand if you want to give up helping me. Max
Re: Open a LC document using a standalone
Hi Max,
I never give up!
You create a standalone from stack "testa.livecode".
But then that is not a STACK anymore and so there is NO file "testa.livecode" inside of the "resources" folder! That's why we end with a 0 KB file.
You want to edit, modify and save stack "testB.livecode", so you need to copy THAT stack to the users DOCS folder and open it:
Next time please check "the result" as suggested, it may have given you something like "No such file".
Best
Klaus
I never give up!
OK, I think I can see the little misunderstanding now:
You create a standalone from stack "testa.livecode".
But then that is not a STACK anymore and so there is NO file "testa.livecode" inside of the "resources" folder! That's why we end with a 0 KB file.
You want to edit, modify and save stack "testB.livecode", so you need to copy THAT stack to the users DOCS folder and open it:
Code: Select all
on openstack
## Create path to RESOURCES folder!!!!! and target stack in the users docs folder
put specialfolderpath("resources") & "/testb.livecode" into tSourceStack
put specialfolderpath("documents") & "/testb.livecode" into tTargetStack
## check if stack already exists:
if there is not a file tTargetStack then
put url("binfile:" & tSourceStack) into url("binfile:" & tTargetStack)
end if
## Now open that stack that we can modify and SAVE!
go stack tTargetStack
end openstack
Best
Klaus
Re: Open a LC document using a standalone
OK Klaus
The main Stack is in my documents folder. I am ready to add the code you shared, and build a standalone.
Here is here I am stuck : What is the "editable" stack That I add via the "Copy files" tab? I understand you to say I need only one stack. So what am I adding? DO I need 1 stack or two? Am I making a second copy of my stack and copying it into the the "Copy files" tab?
Dazed and confused, Max
1. Add that "editable" stack via the "Copy files" tab in the "standalone builder settings"!
2. When your app starts, copy that stack over to the users documents folder,
this is where we definitivley have WRITE (save a stack) permission!
(I assume this is done with the code you sent me.)
3. use the copied folder from now on.
The main Stack is in my documents folder. I am ready to add the code you shared, and build a standalone.
Here is here I am stuck : What is the "editable" stack That I add via the "Copy files" tab? I understand you to say I need only one stack. So what am I adding? DO I need 1 stack or two? Am I making a second copy of my stack and copying it into the the "Copy files" tab?
Dazed and confused, Max
1. Add that "editable" stack via the "Copy files" tab in the "standalone builder settings"!
2. When your app starts, copy that stack over to the users documents folder,
this is where we definitivley have WRITE (save a stack) permission!
(I assume this is done with the code you sent me.)
3. use the copied folder from now on.
Re: Open a LC document using a standalone
Hi Max,
we have two stacks:
1. "splash.livecode"
Which has NO functionality except to open the stack you want to work on and save.
That standalone is made from THIS stack!
2. "you actual stack.livecode"
This one is the stack you wanted to create a standalone from but can't because you want to edit and SAVE this stack at some point.
OK, now you decide!
Best
Klaus
we have two stacks:
1. "splash.livecode"
Which has NO functionality except to open the stack you want to work on and save.
That standalone is made from THIS stack!
2. "you actual stack.livecode"
This one is the stack you wanted to create a standalone from but can't because you want to edit and SAVE this stack at some point.
OK, now you decide!
Best
Klaus
Re: Open a LC document using a standalone
Hi Klaus,
Yes, This is how I originally had it. The stack.livecode ("Testb") was included in the Splash.livecode ("Testa") via the "Copy files" tab , before making the standalone
So the Splash.livecode standalone would create a stack.livecode in the documents folder that was completely empty.
The url("binfile:...) into url ("binfile:...) only made an empty copy of a file.
SO why doesn't the work? Why is the file empty? Did you see may examples files. It seems I followed your directions completely but the file is still empty.
Densely yours, Max
Yes, This is how I originally had it. The stack.livecode ("Testb") was included in the Splash.livecode ("Testa") via the "Copy files" tab , before making the standalone
So the Splash.livecode standalone would create a stack.livecode in the documents folder that was completely empty.
The url("binfile:...) into url ("binfile:...) only made an empty copy of a file.
SO why doesn't the work? Why is the file empty? Did you see may examples files. It seems I followed your directions completely but the file is still empty.
Densely yours, Max
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Open a LC document using a standalone
Hi Max,
Best regards
Jean-Marc
"Copy files" tab is only for non stack files("Testb") was included in the Splash.livecode ("Testa") via the "Copy files" tab , before making the standalone
Best regards
Jean-Marc
https://alternatic.ch
Re: Open a LC document using a standalone
You can add ANY type of file including LC files via the "Copy files" tab!
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Open a LC document using a standalone
Hi Klaus,
I'm a little confused about copy files tab where I can read:
Jean-Marc
I'm a little confused about copy files tab where I can read:
Kind regardsnon-stack files in the application
Jean-Marc
https://alternatic.ch