With the arrival of FileMaker Pro 18, it is now possible to create, edit, or delete files. By coupling these new features with the perform script on server functionality, it is now even possible to create, modify and delete files directly in the Documents folder of FileMaker Server.
However, on macOS, it was only possible to interact with files directly created by FileMaker Pro 18. Indeed, we can see that all files created in the Documents folder, other than by FileMaker Pro 18, have read permissions, only for the user group "fmsadmin". This group is used by FileMaker Server 18 when it has to manipulate files when a script is running for example.
Galvatek, an industrial company with whom we have worked for many years, entered the majority of its orders through third-party software and then re-entered them into the FileMaker Pro solution which manages the entire production chain of the company. This double entry being tedious, we thought about a solution that would automate the entry in their FileMaker Pro solution. After exporting the new commands to be entered in the Documents folder of FileMaker Server 18, we created a system to import all datas into the FileMaker database. The idea was to be able to delete the batch files from the Documents folder after importing them. Then arose the problem of permissions on these files that we could not delete directly by script with the new delete function because of the access permissions of the "fmsadmin" group. To solve this problem we created a property list file (.plist) executed by the Launch Agents (launchd) of macOS. Its role is to automatically grant read / write rights to the "fmsadmin" group for all files newly added to the Documents directory in FileMaker Server 18.