access to application files
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
access to application files
Currently I am trying to port an old Windows application (written in toolbook) to Livecode (for Apple and Windows).
In our application we use nearly 400 Audiofiles. One solution is to load the Audiofiles with "file -> import as Control -> audio File..." in the Application.
But so I will get an application of nearly 800 MB.
I would like to load the needed Audios at runtime. But how can I access the files, because I do not now the Installation location of the Application, and How can I give the Files to the Application (???? File -> Standalone application Settings -> Copy Files)
Thanks
In our application we use nearly 400 Audiofiles. One solution is to load the Audiofiles with "file -> import as Control -> audio File..." in the Application.
But so I will get an application of nearly 800 MB.
I would like to load the needed Audios at runtime. But how can I access the files, because I do not now the Installation location of the Application, and How can I give the Files to the Application (???? File -> Standalone application Settings -> Copy Files)
Thanks
Re: access to application files
Hi thebelg,
The files in the copy files pan are in a folder of the package:
Contents/MacOS
Best regards
Jean-Marc
The files in the copy files pan are in a folder of the package:
Contents/MacOS
Best regards
Jean-Marc
https://alternatic.ch
Re: access to application files
Thanks jean-Marc for this hint, but how can I now access ths file in the application
play audiofile sample.wav
???
Best Regards
play audiofile sample.wav
???
Best Regards
Re: access to application files
Hi thebelg(ium?)
I would create a little function that returns the correct path to that folder:
Use it like this:
...
## AUDIOCLIP not audiofile!
play ac (fStandAloneFolder() & "your_sound.wav")
## or if you have the files in a subfolder "sounds"
play ac (fStandAloneFolder() & "sounds/your_sound.wav")
...
Best
Klaus
I would create a little function that returns the correct path to that folder:
Code: Select all
function fStandAloneFolder
## The stack that is "turned" into a standalone on OSX will "live" in the MacOS folder as described by Jean-Marc
## I use EFFECTIVE, so it will also work for SUBSTACKS, who do not have a filename of their own!
put the effective filename of this stack into tFileName
set itemdel to "/"
## We only need the FOLDERNAME
delete item -1 of tFileName
## This will also delete the last SLASH, so we add it again to make the fiction ready-to-use!
return tFileName & "/"
end fStandAloneFolder
...
## AUDIOCLIP not audiofile!
play ac (fStandAloneFolder() & "your_sound.wav")
## or if you have the files in a subfolder "sounds"
play ac (fStandAloneFolder() & "sounds/your_sound.wav")
...
Best
Klaus
Re: access to application files
Hallo Klaus,
thanks for your answer. I will test it an give you a replay
thebelg (cames from belgium but lives in germany)
thanks for your answer. I will test it an give you a replay
thebelg (cames from belgium but lives in germany)
Re: access to application files
Ah, alles klar 

Re: access to application files
Hallo Klaus,
I've just tested your tip, and it works fine (on Mac and Windows).
Regards (schöne Grüße)
I've just tested your tip, and it works fine (on Mac and Windows).
Regards (schöne Grüße)
Re: access to application files
Dag or Bonjour thebelg,
Klaus
that was the plan!thebelg wrote:I've just tested your tip, and it works fine (on Mac and Windows).

Groetjes or au revoirthebelg wrote:Regards (schöne Grüße)
Klaus