I need to create an app that gives my customers access to PDF's, PPS and some other files which are stored in FM. My app has hundreds of files so I need a way of copying them into a FM file automatically rather than doing it one-by-one. Ideally everything in a selected folder should be imported. (The reason for using FM is to stop them from easily taking copies of the files etc).
Thanks in advance.
FileMaker does not have native tools to Import files (as files) from a folder. It has the ability to Import 1 file, given an absolute or relative file path. So, what you need is a tool to "list" files in a specified or chosen folder.
If you're on a Mac, you'd likely use AppleScript for this. While there a few variations, the simplest command is "list folder". On a PC, you might use the free MooPlug plug-in, with a similar command. Or, if must have a single cross-platform method, you can use 360Works' ScriptMaser plug-in (which takes a lot more code to do it, but comes with examples).
The basic idea is to get a the file names (or full paths) as lines, into a FileMaker text field (usually global). Then use a counter in a Loop, to pull them out 1 at a time, coerce the path to a FileMaker syntax path, set that into a script Variable, then use that as the path for the Import.
Two questions then are:
1. What platform(s)?
2. Do you know the folder ahead of time, or does the user need to choose it?