DaCo Posted June 12, 2012 Posted June 12, 2012 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?
DaCo Posted June 12, 2012 Author Posted June 12, 2012 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.
comment Posted June 12, 2012 Posted June 12, 2012 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.
DaCo Posted June 12, 2012 Author Posted June 12, 2012 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.
DaCo Posted June 12, 2012 Author Posted June 12, 2012 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
comment Posted June 12, 2012 Posted June 12, 2012 This "goofy" solution is actually what I meant in the first place.
DaCo Posted June 13, 2012 Author Posted June 13, 2012 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.
DaCo Posted August 3, 2012 Author Posted August 3, 2012 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 ...?
comment Posted August 3, 2012 Posted August 3, 2012 Try pressing Escape or Command-Period. Alternatively, you could open the file by defining a relationship to it from another file.
DaCo Posted August 3, 2012 Author Posted August 3, 2012 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:
Recommended Posts
This topic is 4843 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now