wjmartin Posted May 16, 2008 Posted May 16, 2008 Just looking for some basic pointers on this; I have a script that builds a complete email ie: it populates, the address, subject and message body. I am now being asked if I can make the body into a PDF file. I have managed to trigger an empty email with the PDF sitting in the body, but thus far, I cant manage to populate the address and subject lines of the email. Any ideas how this can be achieved?
jstaphse Posted May 16, 2008 Posted May 16, 2008 I have a script that first saves the found set as a pdf into the systems temp folder, then I use the send mail and attach the PDF just created. For security purposes I overwrite the PDF after sending the email.
wjmartin Posted May 16, 2008 Author Posted May 16, 2008 That sounds good - create a PDF, then attach it to an email. What I am not sure about is the location of the PDF. I dont know what the Systems Temp Folder is but different machines will have different drive names. Is it possible to script a file location that will be universal for all my (Mac OSX) clients?
bcooney Posted May 16, 2008 Posted May 16, 2008 In FM9 there is a new function Get (TemporaryPath) that resolves to the OS temporary folder. Since the profiles are often not updated, perhaps you have FM9?
wjmartin Posted May 16, 2008 Author Posted May 16, 2008 Correct - I am using v9 but forgot to update my profile. To my embarrassment all my FM books are on v7,8 and 8.5 so I had not heard of this script step. Time to go shopping for new books! Thanks for your help.
Fenton Posted May 16, 2008 Posted May 16, 2008 (edited) I don't know what FileMaker 9 books say about this new function. But there is some discussion (on TechNet) about what exactly that folder does with files. If you open it and watch you will see that FileMaker creates and deletes (when it quits) FileMaker application temporary files within that folder. But I don't know when, if ever, other files are deleted (if you know, please tell us). FileMaker doesn't delete them when it quits. The OS does not delete them when you restart. I have a file I put in there (manually) 4/10/2008. It's still there. So it is not really the OS temporary folder, of which there's more than one. Each user has one (I'm going to use AppleScript path syntax, but you can convert to FileMaker easily), If you're the only user it will be: "Macintosh HD:private:var:tmp:folders.501:TemporaryItems:" But if multiple users yours may be 502, etc.. AppleScript can easily get that path, with: path to temporary items Which you can set to a global field, using the Perform AppleScript step. Anything in that folder will be deleted upon restart. So, if you're exporting a lot of large PDFs, I'd investigate. To see FileMaker's temp folder, run this AppleScript. set p to alias "Macintosh HD:private:var:tmp:folders:501:TemporaryItems:FileMaker:" tell application "Finder" open p activate end tell Notice the subtle difference. FileMaker's path has: folders:501 You user temp folder has: folders.501 [P.S. There is also a Get ( SystemDrive ) function in FileMaker (came out in 8), which can get the hard drive name, if you want to try and calculate the path directly. But there's still the 501, 502 problem. Though most people are going to be 501.] Edited May 16, 2008 by Guest
Recommended Posts
This topic is 6036 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