Page 1 of 1
Unable to find files added in standalone settings
Posted: Thu Oct 31, 2019 4:54 pm
by Simon Knight
Hi,
I'm using a mac and have written an app that calls a shell script - well I think thats what it is called. This shell script is a small file that displays a unix file icon.
I have put this shell script in the Copy Files section of the standalone settings. Next I added a button with the following code :
Code: Select all
on mouseUp pMouseButton
answer folder specialfolderpath("resources")
end mouseUp
I build and run my app and press the button. I expected to see a folder and shell script but instead I see my desktop folder. obviously I have misunderstood so please advise me on where to store my unix code for use in my standalone.
Re: Unable to find files added in standalone settings
Posted: Thu Oct 31, 2019 5:07 pm
by Simon Knight
Ah! & doh!
The answer folder can not display or open the resources folder. It displays a path and then shows the last real folder that was viewed.
Re: Unable to find files added in standalone settings
Posted: Thu Oct 31, 2019 5:12 pm
by Klaus
Hi Simon,
since you probably want to access the files in that folder, you could:
Code: Select all
...
launch document specialfolderpath("resources")
...
Looks like "ask folder" is not supported in LC!?
I tried:
Code: Select all
...
## Like -> ask file "Select a file:"
ask folder "sdsdsdd"
...
I got:
Script compile error:
Error description: Handler: bad command
Best
Klaus
Re: Unable to find files added in standalone settings
Posted: Thu Oct 31, 2019 5:13 pm
by Klaus
Oh, sorry, I mixed ASK with ANSWER...
Re: Unable to find files added in standalone settings
Posted: Thu Oct 31, 2019 6:03 pm
by Klaus
Try this, works at least in the IDE:
Code: Select all
...
answer folder "Select a folder:" with specialfolderpath("resources")
...
Re: Unable to find files added in standalone settings
Posted: Thu Oct 31, 2019 6:05 pm
by Klaus
Simon Knight wrote: ↑Thu Oct 31, 2019 5:07 pm
Ah! & doh!
The answer folder can not display or open the resources folder. It displays a path and then shows the last real folder that was viewed.
Not really, but here -> specialfolderpath("resources") is cosidered the (missing) PROMPT, check the top of the dialog.
And then it just shows the last used folder.
Re: Unable to find files added in standalone settings
Posted: Fri Nov 01, 2019 9:00 am
by Simon Knight
Hi,
I'm still wearing the pointy hat and standing in the corner : the file in question is an executable so I now know that this means that the file is not in the resources folder but it gets stored in the engine folder. (now I can't get the image of a large black steam engine out of my mind....)
It would be nice if the standalone settings pane listed the path to the files - I mean it must know.
best wishes
Simon
Re: Unable to find files added in standalone settings
Posted: Fri Nov 01, 2019 10:08 am
by SparkOut
specialFolderPath("resources") is still relevant to standalones. It is most likely what you need.
"engine" is much less relevant to how it used to be - it is specific to the relative path of the actual LC engine according to whether a standalone or the IDE. Essentially they historically point to the same place but "resources" will find your resource files wherever they may be according to what you have included in the copy files pane of the standalone builder settings.
Re: Unable to find files added in standalone settings
Posted: Fri Nov 01, 2019 10:56 am
by Simon Knight
Hi,
No I'm afraid that is not what happens at this end. The script was not found when the standalone was built and looked for the resources folder. However, it does work when the engine folder is used.
"engine": The folder containing the LiveCode engine and the executable files copied in the standalone application
"resources": In development mode, the current stack's folder. In a standalone, the resources folder where files or folders specified in the Standalone Builder are located.
I suspect that engine is the location because the file in question is an executable.
Simon
Re: Unable to find files added in standalone settings
Posted: Fri Nov 01, 2019 12:42 pm
by Klaus
Ah, yes, this happend to me, too in the past.
Yes, true, the standalone builder put any EXECUTABLE file into -> specialfolderpath("engine")