Page 1 of 1

Copy Files query

Posted: Sat Aug 27, 2011 12:49 pm
by gjtaylor99
Hi :)

I've got a stack that references a folder of .au audio files (named "audiofilesfolder") in the same parent folder as the stack itself. I'm using the BYU defaultFolder routine in the stack script to switch the defaultFolder location to the parent folder:
on openStack
set the itemDelimiter to "/"
get the effective fileName of this stack
set the defaultFolder to item 1 to -2 of it
--answer the defaultFolder
end openStack

It all works fine until I make a standalone application for Mac OS X. I can't seem to get the audio files to be included with the app. A folder with the correct name is included in the Package Contents of the app, inside the MacOS folder, but it's always empty. I can manually copy the audio files into this audio folder, and then everything works correctly in the app. But I'm wondering how to configure things so that the audio files are automatically copied into the audio files folder inside the MacOS folder in Package Contents.

I assume the issue is with the way I'm configuring the Copy Files tab of the Standalone Application Settings. I've got it set to:
1. "Non-stack files in the application: audiofilesfolder/*
2. Copy Referenced Files = selected
3. Destination Folder: audiofilesfolder

I've tried every permutation I can think of with no joy. Any suggestions? Thanks!

Re: Copy Files query

Posted: Sat Aug 27, 2011 3:42 pm
by Klaus
Hi gjtaylor99,

I just made a quick test and used the "Add folder" button to add a folder full of JPEG images to my standalone.
Saved as standalone and the folder was inside of the app package!
What am I missing?

What version are you using?


Best

Klaus

Re: Copy Files query

Posted: Sat Aug 27, 2011 4:24 pm
by gjtaylor99
Klaus wrote:What am I missing? What version are you using?
Thanks for your reply, Klaus. I'm using the latest version, 4.6.3 if i remember right. When I get back to my computer I'll try to duplicate what you've done, with images. Maybe it's an incompatible sound file format that's the issue. Many thanks for this!

Re: Copy Files query

Posted: Sat Aug 27, 2011 4:41 pm
by Klaus
I doubt that LiveCode will copy a folder and its content depending on the fileformat of the files inside of that namely folder 8)

Re: Copy Files query

Posted: Sat Aug 27, 2011 4:45 pm
by gjtaylor99
gjtaylor99 wrote:When I get back to my computer I'll try to duplicate what you've done, with images. Maybe it's an incompatible sound file format that's the issue.
Yes, I CAN duplicate what you did, Klaus, but it only copies over one single image, one which I directly referenced in an image area in my stack. The other images in the folder, which were not referenced, were not imported.

My stack doesn't actually directly reference any of the audio files, instead, calling on them at random, concatenating the file names from several elements. So I guess, because there are no direct references to any of the sounds in my stack's code, that could be the reason why they weren't imported.

I'll try including a direct reference and see if that helps.

Thanks again!

Re: Copy Files query

Posted: Sat Aug 27, 2011 4:52 pm
by Klaus
Hmmm, here is what I did:
1. Created an empty stack NO CONTENT, no images, no whatever!
2. Save it to disk
3. Added that folder in the standalone builder settings
4. Saved as standalone and ALL images where in that folder in the resulting app package!?

Re: Copy Files query

Posted: Sat Aug 27, 2011 6:54 pm
by jacque
gjtaylor99 wrote:
gjtaylor99 wrote:When I get back to my computer I'll try to duplicate what you've done, with images. Maybe it's an incompatible sound file format that's the issue.
Yes, I CAN duplicate what you did, Klaus, but it only copies over one single image, one which I directly referenced in an image area in my stack. The other images in the folder, which were not referenced, were not imported.

My stack doesn't actually directly reference any of the audio files, instead, calling on them at random, concatenating the file names from several elements. So I guess, because there are no direct references to any of the sounds in my stack's code, that could be the reason why they weren't imported.

Right. When you set "Copy referenced files", that's all it will copy. Uncheck that option and all your files should come over.

Re: Copy Files query

Posted: Sat Aug 27, 2011 10:56 pm
by gjtaylor99
Klaus wrote:Hmmm, here is what I did:
1. Created an empty stack NO CONTENT, no images, no whatever!
2. Save it to disk
3. Added that folder in the standalone builder settings
4. Saved as standalone and ALL images where in that folder in the resulting app package!?
Thank you, Klaus. I will try again.
Geoff

Re: Copy Files query

Posted: Sat Aug 27, 2011 11:01 pm
by gjtaylor99
jacque wrote:Right. When you set "Copy referenced files", that's all it will copy. Uncheck that option and all your files should come over.
Thanks, Jacqueline, I have no doubt you've nailed the solution. Missed it somehow... That's brilliant. I'll check it out tomorrow. :D

Re: Copy Files query

Posted: Sun Aug 28, 2011 9:21 am
by gjtaylor99
gjtaylor99 wrote:
jacque wrote:Right. When you set "Copy referenced files", that's all it will copy. Uncheck that option and all your files should come over.
Thanks, Jacqueline, I have no doubt you've nailed the solution. Missed it somehow... That's brilliant. I'll check it out tomorrow. :D
Drat! Tried this, and it didn't work. Only the folder is copied/created, not the files inside it.

Tried adding the files individually. Result: standalone process created files with the same names and suffixes, e.g. my sound.au, but zero content, I mean, zero kb file size. That's why I think the process is creating, not copying the files.
:?

Re: Copy Files query

Posted: Sun Aug 28, 2011 9:30 am
by gjtaylor99
Klaus wrote:Hi gjtaylor99,
I just made a quick test and used the "Add folder" button to add a folder full of JPEG images to my standalone.
Saved as standalone and the folder was inside of the app package!
I've done what you did: made a new mainstack with a folder of images (a mixture of JPGs and GIFs) alongside it in the same parent folder, and a folder of .au sound files too in the same parent folder. Used the "Add folder" button. Result: an app with the correct folders inside the MacOS folder, but the folders are empty. :?

Re: Copy Files query

Posted: Sun Aug 28, 2011 9:39 am
by gjtaylor99
gjtaylor99 wrote:Tried adding the files individually. Result: standalone process created files with the same names and suffixes, e.g. my sound.au, but zero content, I mean, zero kb file size. That's why I think the process is creating, not copying the files.
Blimey, tried it again, and now the individual files ARE copying correctly. But the "Add folder..." which should copy all the contained files, still doesn't work. I'll try re-installing the app, maybe there's a glitch... :x

Re: Copy Files query

Posted: Sun Aug 28, 2011 10:00 am
by gjtaylor99
gjtaylor99 wrote:Blimey, tried it again, and now the individual files ARE copying correctly. But the "Add folder..." which should copy all the contained files, still doesn't work. I'll try re-installing the app, maybe there's a glitch
:D Bingo! A re-installation has solved the problem. With my test mainstack, the "Add folder.." option now functions correctly when making a standalone app, creating the correct folders in the MacOS folder, and including all the correct files.

Thank you so much, Klaus and Jacqueline, for the time you spent helping me with this.

Re: Copy Files query

Posted: Sun Aug 28, 2011 11:12 am
by gjtaylor99
gjtaylor99 wrote:
gjtaylor99 wrote:Blimey, tried it again, and now the individual files ARE copying correctly. But the "Add folder..." which should copy all the contained files, still doesn't work. I'll try re-installing the app, maybe there's a glitch
:D Bingo! A re-installation has solved the problem.
:( Hmn, actually, it turns out this feature is "temperamental" on my system. It worked once with a new mainstack, but it hasn't worked again with that stack, and it doesn't work at all with my own project. Oh well, I've spent too much time messing about with this. I'll leave it now. Hopefully, an application update from runrev or maybe a Mac OS X Lion update from Apple will fix things...