Files in Resources Folder?

Hi,
could someone please tell me if it’s permissible to put a text file into my app’s resources folder, and then read it into a text area, when the app is destined for the MAS?

Thank you all in advance.

[quote=192412:@Richard Summers]Hi,
could someone please tell me if it’s permissible to put a text file into my app’s resources folder, and then read it into a text area, when the app is destined for the MAS?[/quote]

Sure.

Thanks Michel :slight_smile:

Cute avatar :wink:

are there post build instructions to copy a file into the resource folder?

You just drag it into the IDE of the project, and refer to it by name

for example if you drag “myfile.txt” into the IDE

you code would say something like

dim s as string=myfile

and “s” would contain the contents of your file

the same thing can be done with PNG, JPG, PDF, HTML etc.

NOTE : DO NOT ATTEMPT TO WRITE TO THE BUNDLE after it has been compiled (see other topics on this forum that discuss why this is a “Bozo No-No”

There sure are!

In the IDE highlight OS X, then press the Insert button (1st on task bar), select ‘Build Step’ and then ‘Copy Files’. This will create a new CopyFiles1 build step under OS X and Following the Build step. In the main area you drop the files that you need. When you have dragged the files there select in the right hand side of the IDE the location you want, whether to send in debug or build or both, whether to place in a sub-folder.

Simon.

[quote=192457:@Simon Berridge]There sure are!

In the IDE highlight OS X, then press the Insert button (1st on task bar), select ‘Build Step’ and then ‘Copy Files’. This will create a new CopyFiles1 build step under OS X and Following the Build step. In the main area you drop the files that you need. When you have dragged the files there select in the right hand side of the IDE the location you want, whether to send in debug or build or both, whether to place in a sub-folder.

Simon.[/quote]

It should be noted that the Copy File Step, in spite of its name, copies also folders, unlike dragging in the project which does not.
I discovered that only recently.

[quote=192476:@Michel Bujardet]It should be noted that the Copy File Step, in spite of its name, copies also folders, unlike dragging in the project which does not.
I discovered that only recently.[/quote]
It’s actually very useful to copy in folders as Xojo does a merge, so if you set it to copy in a ‘Resources’ folder to the ‘Contents’ folder, you simply manage the resources folder like… a regular folder… And Xojo will merge all the items into the apps Resources folder, I also use this for plugins, helpers and everything else.