Automated server based scripts for Importing or Exporting are a great way of moving time consuming jobs away from users. Whether it is exporting a report from a complex find or generating records overnight to save the users time during the day, there are two very important things to remember.
First: you cannot import from a FileMaker file, not even table to table in the same file.
Second: you only have a limited set of folders to import into.
The simple work around to problem one is that you have to export your records (as say csv) and then import them in to the required table.
The answer to problem two is that you can use either the Temporary or Documents folders. If you use the Temporary folder the path can be generated from Get(TemporaryPath) . The Documents path can be generated from Get(DocumentsPath).
The difference? – the Temporary path is only valid during the running of the script, when the script finishes anything in the temporary folder is deleted. Ideal for temporary exports when doing pseudo table to table imports.
The documents Path can be found at /Library/FileMaker Server/Data/Documents/ if you want to place items ready for server import or want to get the exported files.
NB – You can also use child folders of either of these if you want to be more structured in the way you store your files.