Page 4 of 4

Re: Open a LC document using a standalone

Posted: Wed May 09, 2018 1:18 pm
by Klaus
jmburnod wrote:
Wed May 09, 2018 1:07 pm
Hi Klaus,
I'm a little confused about copy files tab where I can read:
non-stack files in the application
Kind regards
Jean-Marc
Doesn't matter, also works with Livecode files. :-)

Re: Open a LC document using a standalone

Posted: Wed May 09, 2018 9:25 pm
by jacque
maxs wrote:
Wed May 09, 2018 1:00 am
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
Most likely the file paths are incorrect, as Richard noted. It sounds like you have the setup correct:

StackA will be the standalone, with all standalone options filled out in Standalone Settings.
StackB is the data stack to be included with the build. It is listed in the Copy Files pane of Standalone Settings.

When LC builds the standalone, anything in Copy Files is put into a folder named "resources" which the standalone builder creates. The correct path to that folder and its file is: specialFolderPath("resources") & "/stackB.livecode"

Since files can't be saved inside the application folder, you need to copy StackB to a writeable location. That can be the desktop ("specialFolderPath("desktop")) or documents, or some other places. Let's assume you want it to go to Documents: specialFolderPath("documents")

So the copy mechanism is:

Code: Select all

put specialFolderPath("resources") & "/stackB.livecode" into tSourcePath
put specialFolderPath("documents") & "/stackB.livecode" into tDestPath
put ("binfile:" & tSourcePath) into ("binfile:" & tDestPath)
Note that special folder paths are lower-case, and the whole path structure must be inside parentheses so it will evaluate correctly.

Re: Open a LC document using a standalone

Posted: Thu May 10, 2018 12:14 am
by maxs
Hi Jacque

I'm so impressed with myself that I came to the same conclusion today. It may be an incorrect path or name. Now I will try testing it out. Thanks, Max

Max

Re: Open a LC document using a standalone

Posted: Thu May 10, 2018 1:29 am
by maxs
Breakthrough:

I did it.

Here are the 4 major errors I made:

The resource file name needed to be the same as the document file name. (I had the Standalone file as the app resource name. I never understood that they are basically the same file. )
There were uppercase letters.
I needed to delete ".livecode" from the file name of the embedded resource stack.
I could not find any documentation on this in the Livecode library.

Thanks to Jacque and Klaus for following through with me. This was really a difficult process for me to understand.

Re: Open a LC document using a standalone

Posted: Thu May 10, 2018 1:39 am
by maxs
postscript

THe forums have become the basic lifesaver for my most urgent problems I have making app, thanks to a few really kind people.

Nevertheless, it is insanely difficult to get clarifications of things when communication is not back and forth as easily as it is with talking or chatting.

I would gladly pay for the instant gratification of instant communication, if that ever became available. But I can understand why people giving help prefer it this way.

Re: Open a LC document using a standalone

Posted: Thu May 10, 2018 6:22 am
by jacque
Bravo! So glad you got it working. When you're first starting there's a lot to learn, but soon things will feel commonplace. The "eureka" moment at the end of a long struggle can be a giddy reward though.

One advantage of written explanations is that others who follow can find answers. But I do understand that it's often easier to talk through issues where clarifications can be more immediate. Many of the old-timers here would probably be available for consulting work if it comes to that.

Re: Open a LC document using a standalone

Posted: Thu May 10, 2018 5:44 pm
by jacque
You know, looking at my example script I see that I omitted the URL keyword. Did it work as written? It should have been:

put url ("binfile:" & tSourcePath) into url ("binfile:" & tDestPath)

We all have blackouts occasionally I guess. You can't trust anyone these days. :)