Yes, it is very exciting, however:
I have the same issue from my 'custom scripts' which create pdf's, but I found the pdf's will go into the FMGo 'Files on Device' folder. You know, the one when you startup FMGo. On tap, they open, but I cannot find the 'send by email' button.
I guess, my 'send email' scripts for ie invoice, estimates etc, need to be changed. The only error message I am currently getting is 'Enter preview is not supported', it open an email for to the recipient, but NO PDF ATTACHED....
Need to find a solution for that one!
Yep, I need this as well. Maybe it is a bug? or an unsupported feature at this time?
Detlef Hebbel and mtamitch:
Thank you for your posts.
The file paths are different on a Mac and iPad/iPhone/iPod touch. Therefore, you will have to modify your script. Thanks to our Software Quality Assurance (Testing) department for providing the following sample script:
Set Variable [ $FileName ; Value: "Test_" & Substitute ( Get ( CurrentDate ) ; "/" ; "-" ) & ".pdf" ]
Save Records as PDF [ No dialog ; "$FileName" ; Records being browsed ]
Set Variable [ $PDFPath ; Value: Get (DocumentsPath) & $FileName ]
Send Mail [ Send via E-mail Client ; To: "email@example.com" ; Subject: "Invoice" ; Message: "Test" ; "$PDFPath" ]
There is a caveat. On an iPad/iPhone/iPod touch, the PDF files are not overwritten. If you perform this script twice on the same day (for example, today being 9/23/2010), you will have "Test_9-23-2010.pdf" and "Test_9-23-2010 1.pdf" files, and the script would attach the original PDF file both times. Therefore, make sure you have a way to make the filename unique. One way is by appending an Auto-enter serial number field or using an incremental variable.
Let me know if you need additional clarification.
I have confirmed that this works. Sweet! To put it into simpler terms, simply use the "Get (DocumentsPath)" calc and name the document something unique, if you are going to attach that document to an email more than once per day.
Yes, works perfect for FMGo!
Thanks a lot to TSGal and Software Quality Assurance (Testing) department for providing the sample script.
Yes, thanks for that TSGal. I have it working now.
Can Some help out with the pdf email I am new with scripting so I really not sure how to do this type of script but I did fumble through it. This script I got from previous post where it is suppose to attach pdf to email and but the email address and subject. Below is a image of what I changed but it is not working the only thing it does is add the email address, the subject and in the message section it put TEST.
In the image below on the last line "$PDFPath" I was not sure how to add it so I used the attach check box to add $PDFPath.
What am I doing wrong?
This is the originalSet Variable [ $FileName ; Value: "Test_" & Substitute ( Get ( CurrentDate ) ; "/" ; "-" ) & ".pdf" ]Save Records as PDF [ No dialog ; "$FileName" ; Records being browsed ]Set Variable [ $PDFPath ; Value: Get (DocumentsPath) & $FileName ]Send Mail [ Send via E-mail Client ; To: "firstname.lastname@example.org" ; Subject: "Invoice" ; Message: "Test" ; "$PDFPath" ]
It appears you are doing everything correctly. However, It may be a misprint, as it looks like the last line of your script has an extra quote in front of $PDFPath. Make sure when you click the "Attach file" checkbox that you are entering under "Specify...": $PDFPath That is, no quotes.
You guys are great, thanks it worked perfectly.
Duplicate PDF email sent, I forgot about this part;
How do I do this part since i will be sending a different record during the course of one day.
Therefore, make sure you have a way to make the filename unique. One way is by appending an Auto-enter serial number field or using an incremental variable.
One possible workaround is to store a value in a global field and increment it each time you send an email. For this example, create a Number field with global storage and name it g_global.
Change the first script step to read:
Set Variable [ $FileName ; Value: "Test_" & g_global & ".pdf" ]
Instead of the date, this will append a number to the end of the $FileName. Test_1.pdf, Test_2.pdf, etc.
The trick is to increment the field g_global each time you Send Mail. Therefore, after the Send Mail step, add the script step:
Set Field [ g_global ; g_global + 1 ]
This will get the value ready for the next time you want to send an email as the file will then have a unique name.
Let me know if you need additional explanation.
I'm trying use this script for my invoices, but it saves the PDF in the Filemaker Program file. How can I change the script so that I can save it somewhere else?
Also, I can't seem to get the file to attach to the email. The email opens and inputs all the specified data, but does not attach the pdf.
This is what mine looks like:
Thank you for your post.
At this time, you cannot save the PDF file elsewhere.
Can you verify the PDF file gets created? If so, open the PDF file and make sure information is displayed. If it is blank, then the email will appear as though nothing was attached when in fact is is a blank document attached.
Thank that worked for me