Access Resource Files
sundown at pacifier.com
Fri Sep 20 05:11:54 EDT 2019
Thanks for the info! A file path alone does not work for me.
Here is what I have tried.
In the Stack Script;
put the defaultFolder into dirName
—From a button on a card;
--/Users/JB/Desktop/Buss X-82/Buss X-82.app/Contents/Resources/myPic.jpg
put dirName & "/Buss X-82.app/Contents/Resources/myPic.jpg/" into fPath
That is how I can get a file path but using this path will not work if the path
directs to a bundle but it will work if the file is not in a bundle.
That being said how do I go about copying this file with specialfolderpath() ?
Do I need to go to the standalone settings and add the file using copy files
section and then from within my app I can copy that file but if I add it my
self after the .app is made I will not be able to copy it?
Are you saying this will return the path to my resource in my app and let
me copy it to the desktop? Do you have some more examples of copying
the file with this procedure?
> On Sep 20, 2019, at 1:46 AM, Klaus major-k via use-livecode <use-livecode at lists.runrev.com> wrote:
> Hi JB,
>> Am 20.09.2019 um 10:34 schrieb JB via use-livecode <use-livecode at lists.runrev.com>:
>> Does anyone know of a way to access resource files
>> in the StandAlone .app bundle?
>> Let’s say I want to include a jpg file in my .app bundle
>> & then copy that file to the desktop at various times.
>> From what I understand if you write a external to copy
>> source file to destination file it will work unless they
>> are in the .app bundle.
>> I do not want to include a file saved in a different url.
>> This will be a file located in the .app bundle and then
>> saved to the desktop or a user chosen location that
>> is not in a bundle.
>> My guess is it cannot be done but I would love it if
>> someone proved me wrong.
> everything you add to your standalone via:
> Standalone Application Settings -> Copy files
> can be found in the standalone in:
> specialfolderpath("resources") & "/your wonderful pic.jpg"
> If that is what you mean.
> That specialfolderpath() does also work in the IDE!
> In that case it returns the path to the folder containing the current stack.
> Klaus Major
> klaus at major-k.de
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the use-livecode