It does check to see if the current date is the first of the month, but you'll likely need more logic than that to keep this record from running multiple times on that first day of the month. You might log the date this script was last run so that you can also check to see if the date last run is the same as today or not...
Thank you for your fast answer.
As for the re-run, in this case things should be fine as the mentioned lines are part of a script that runs from the server only once a day, very early in the morning.
For those who don't run scheduled scripts on Server, or who use FM versions before Install OnTimer Script, there is a very easy way to have any script run any time you like. (Forgive me for only giving the Windows version.)
- Create a file with no fields or layouts necessary. For this example, call it 'First Of Month Check'. It only has one script:
- Perform Script [External Script: Choose the file and script you want to run]
- Close File [This file]
- In its File -> Options set this script to run on start-up
In Windows Scheduler set a schedule to open this file when and as often as you like. You can have a whole folder full of such scheduled scripts. Truth be told I still use this a lot, even with Install OnTimer Script.