June 12, 201213 yr In my database "catalogue.fp7" I have made a script (named "update to DCN") making the export of data to Excel. The file is called "update to DCN.xls". It will overwrite the existing file and is located in the same folder every time. There must be a new export every day at 07:00 hours at working days, the file must be attached to an email to "[email protected]" with subject line "Update from [company name]" and the mail must be posted immediately. If FileMaker is not open at that time the program must be started, run the script and close FileMaker when done. How do I do that?
June 12, 201213 yr Author Appendix: It would be nice if the name of the Excel file could contain the current date, eg. "2012-06-12 update two DCN.xls" and absolutely perfect if also the subject line of the mail might be called '2012-06-12 Update from [company name] "- of course with the current date.
June 12, 201213 yr If FileMaker is not open at that time the program must be started, run the script and close FileMaker when done. You can use iCal to run Applescript or open a file on schedule. A simple file that calls the export script in your "real" file should do the job. Appendix: It would be nice if the name of the Excel file could contain the current date Set a variable to the name you want, then use it as the path.
June 12, 201213 yr Author You can use iCal to run Applescript or open a file on schedule. Yep, I've managed to make that. Works perfectly. Inside FileMaker I have created at script which runs my Export-script and then "Exit application". In "File" > "File options" I have set this script to run automaticly when FileMaker opens. And now for the funny part: It works almost too well. Whether I let iCal do the job, or I manually open my database in FileMaker, it does exactly what I asked it of ... and close FileMaker! How should I go in and change something? I am painfully aware that my goofy method is not what you recommend, but I thought even that was brilliant, so I would obviously try it. A simple file that calls the export script in your "real" file should do the job. Set a variable to the name you want, then use it as the path. Hmmm, perhaps I see through it a little later. I need the other to act first.
June 12, 201213 yr Author Another goofy solution: I'm not lost behind a truck - I'm lost down the front at full speed!!! I have created a dummy database which runs a script calling my main database, performs the export, close the file and exit the application. iCal calls this new FMP-filename on schedule. http://en.wikipedia.org/wiki/Eureka_%28word%29
June 13, 201213 yr Author Ahaaa, so "A simple file that calls the export script" was a FileMaker file. I see. I thought it maybe was a simple text file with som script kode in it or something. Okaaaay Well, your post helped me anyway. It got me to think in the right direction. Thank you.
August 3, 201213 yr Author I have created a dummy database which runs a script calling my main database, performs the export, close the file and exit the application. iCal calls this new FMP-filename on schedule. It has been running well for a while, but now I want to make a minor change. But how to? When opening the "self-propelled" database it executes the instructions and close. Can I hold a key to break or ...?
August 3, 201213 yr Try pressing Escape or Command-Period. Alternatively, you could open the file by defining a relationship to it from another file.
August 3, 201213 yr Author Try pressing Escape or Command-Period. Alternatively, you could open the file by defining a relationship to it from another file. Command-Period did the job. Thank you very much :hug:
Create an account or sign in to comment