Our Preferred 5 Star Hosting Provider - Award Wining FileMaker Pro Hosting
Results 1 to 4 of 4
  1. #1
    FREE Member
    Join Date
    Apr 2012
    Posts
    46
    Downloads
    0
    Uploads
    0

    Email Script to Save as PDF and Email

    The Scarpetta Group- our preferred FMT Forum Consultants
    2 Things:

    1. my script save record as PDF has the box create email with this attachment, but it saves the attachment as a windows file not a pdf, when you click on the attachment you have to specify to open with adobe...why?
    2. I want to have the record saved as a pdf and then attached to an email, but i want to specify the contents of the body, subject, etc. of the email. when I script to save as pdf and attach to email it doesn't allow that email to be specified...but if I script to send mail then I loose the save as pdf part.

    Any ways around this?
    Warning: This is an Old Thread
    This discussion is older than 420 days. information contained in it may no longer be current

  2. #2
    Senior Moderator - FMT Preferred Developer Consultant - New York - Worldwide AHunter3's Avatar
    Join Date
    Aug 2006
    Posts
    11,491
    Location
    New York and Nassau County, NY, USA
    FileMaker Version
    FM 9, FM 9 Server, FM 10, FM 11, FM 11 Server, FM 12, FM 12 Developer
    OS
    Windows & Mac
    Skill Level
    Developer
    Downloads
    0
    Uploads
    0

    Re: Email Script to Save as PDF and Email

    Do it in multiple steps:

    Set Variable [$PDFPath; Get (TemporaryPath) & "MyAttachment.pdf"]
    Save Records as PDF [no dialog, $PDFPath, current record]
    Send Mail [To = joe.blow@isp.com, Subject = hello, Message Body = blah blah, Attachment=$PDFPath]

  3. #3
    FREE Member
    Join Date
    Apr 2012
    Posts
    46
    Downloads
    0
    Uploads
    0

    Re: Email Script to Save as PDF and Email

    Ok when I do that - it creates the pdf but does not attach it. I feel like it has something to do with the variable I set - could you explain the value of the variable - it looks like we are just saving it to a temp folder as "blank.pdf"

    When i do this it creates the pdf but does not attach it.

  4. #4
    Senior Moderator - FMT Preferred Developer Consultant - New York - Worldwide AHunter3's Avatar
    Join Date
    Aug 2006
    Posts
    11,491
    Location
    New York and Nassau County, NY, USA
    FileMaker Version
    FM 9, FM 9 Server, FM 10, FM 11, FM 11 Server, FM 12, FM 12 Developer
    OS
    Windows & Mac
    Skill Level
    Developer
    Downloads
    0
    Uploads
    0

    Re: Email Script to Save as PDF and Email

    Hmm. You on a Windows PC? PCs can be weird about their handing of path statements that don't specifically say "filewin" in front of them...

    Try this edited version of the script:

    Set Variable [$PDFPath; Get (TemporaryPath) & "MyAttachment.pdf"]
    ...If [Abs(Get(SystemPlatform)) = 2]
    ...... Set Variable [$PDFPath, "filewin:/"& Middle ($PDFPath, 2, Length ($PDFPath))]
    ...End If
    Save Records as PDF [no dialog, $PDFPath, current record]
    Send Mail [To = joe.blow@isp.com, Subject = hello, Message Body = blah blah, Attachment=$PDFPath]


    As to the "value of the variable", the variable should look something like this:


    filewin:/C:/Documents and Settings/AHumphries/Local Settings/Temp/1/510/MyAttachment.pdf

    I do not know (or understand) why it would ever come up as "blank.pdf" unless you are using "blank.pdf" instead of "MyAttachment.pdf". Meanwhile, it should attach regardless of what name you've given it.

    Can you type out your exact script, VERBATIM?


    Oh, by the way, make sure that you have UNCHECKED the box "create email with this attachment" in the script step "Save Records as PDF". That box should not be checked.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Script for email iwith out email address
    By cterrell16 in forum ScriptMaker and Scripting
    Replies: 2
    Last Post: 10-02-2012, 07:16 AM
  2. Email Script to format body of email
    By Answers in forum FileMaker Pro 8.5
    Replies: 2
    Last Post: 06-17-2010, 06:49 AM
  3. Save pdfs and email
    By athompson in forum FileMaker Pro 10 Advanced
    Replies: 9
    Last Post: 07-20-2009, 08:19 AM
  4. Save as PDF and email
    By leopup in forum FileMaker Pro 8.5
    Replies: 2
    Last Post: 02-03-2009, 07:16 PM
  5. Attach File at END of email using Email Script
    By barensen in forum FileMaker Pro 8.5
    Replies: 2
    Last Post: 04-08-2008, 12:04 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Welcome to the Original FileMaker Forum
With designated forums for almost every FileMaker topic...FileMaker Today is a free-to-join community where you can boost your FileMaker expertise, build better solutions and solve your technical challenges. If you're building FileMaker solutions, this is the place for you.
Follow FMT
We Are FMT
FMT is home of The World's leading FileMaker News Site, Worldwide Developer Directory, FileMaker Connect Community and so much more.