Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
Simon Knight
- Posts: 919
- Joined: Wed Nov 04, 2009 11:41 am
Post
by Simon Knight » Thu Oct 31, 2019 4:54 pm
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.
best wishes
Skids
-
Simon Knight
- Posts: 919
- Joined: Wed Nov 04, 2009 11:41 am
Post
by Simon Knight » 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.
best wishes
Skids
-
Klaus
- Posts: 14206
- Joined: Sat Apr 08, 2006 8:41 am
-
Contact:
Post
by Klaus » Thu Oct 31, 2019 5:12 pm
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
-
Klaus
- Posts: 14206
- Joined: Sat Apr 08, 2006 8:41 am
-
Contact:
Post
by Klaus » Thu Oct 31, 2019 5:13 pm
Oh, sorry, I mixed ASK with ANSWER...
-
Klaus
- Posts: 14206
- Joined: Sat Apr 08, 2006 8:41 am
-
Contact:
Post
by Klaus » Thu Oct 31, 2019 6:03 pm
Try this, works at least in the IDE:
Code: Select all
...
answer folder "Select a folder:" with specialfolderpath("resources")
...
-
Klaus
- Posts: 14206
- Joined: Sat Apr 08, 2006 8:41 am
-
Contact:
Post
by Klaus » Thu Oct 31, 2019 6:05 pm
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.
-
Simon Knight
- Posts: 919
- Joined: Wed Nov 04, 2009 11:41 am
Post
by Simon Knight » Fri Nov 01, 2019 9:00 am
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
best wishes
Skids
-
SparkOut
- Posts: 2949
- Joined: Sun Sep 23, 2007 4:58 pm
Post
by SparkOut » Fri Nov 01, 2019 10:08 am
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.
-
Simon Knight
- Posts: 919
- Joined: Wed Nov 04, 2009 11:41 am
Post
by Simon Knight » Fri Nov 01, 2019 10:56 am
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
best wishes
Skids
-
Klaus
- Posts: 14206
- Joined: Sat Apr 08, 2006 8:41 am
-
Contact:
Post
by Klaus » Fri Nov 01, 2019 12:42 pm
Ah, yes, this happend to me, too in the past.
Yes, true, the standalone builder put any EXECUTABLE file into -> specialfolderpath("engine")