4 Replies Latest reply on Mar 19, 2012 9:18 AM by marco96

    How do I name an email attachment?

    marco96

      Title

      How do I name an email attachment?

      Post

      Hello everyone

      I figured out how to do the script to have a container set up to the email as an attachment, but I'm wondering if there is a way to name the attachment what ever name I want to give it for each individual attachment.

      Here is my script.

      Thank you for any help.

      Marco

      Picture_3.png

        • 1. Re: How do I name an email attachment?
          philmodjunk

          I'm not sure I understand.

          In your example, you named the attachment "contracter.PDF". As I understand your question, you would simply use different text in place of that in your first script step to change the name of the attached file. And there's no container field in the above script, only a variable.

          • 2. Re: How do I name an email attachment?
            marco96

            Hi Phil,

            I was wanting to have the option to name the PDF what ever I wanted. Is there way to do that in the script. Maybe have a field in the layout for naming and direct the script to use that, or maybe a window can pop up during the script and ask me to name the PDF?

            As for not having a containter, I thought it strange as well that I didn't designate a container field, but it works. I thoughout I was sappose to do it that way? I was thinking it worked because I used the save records as "current record". There is only two fields in this layout the container and a comments field and I set thie comments field not to print and I thought maybe that is why the pdf knew which feild to show, because the pdf image turns out right.

            • 3. Re: How do I name an email attachment?
              philmodjunk

              A container with store a reference can be one way to get to the file name and path of an existing file. It does not appear to be needed in this solution.

              Take a look at the first script step:

              Set Variable [$FilePath ; Value: Get ( TemporaryPath ) & "Contractor.PDF" ]

              It names each PDF file "Contractor.PDF". If you change that expression, you can name the file anything you want as long as you specify the .PDF file extension.

              Set Variable [$FilePath ; Value: Get ( TemporaryPath ) & YourTable::YourField & ".PDF" ]

              or

              Set Variable [$FilePath ; Value: Get ( TemporaryPath ) & $$FileName & ".PDF" ]

              Are both workable options that allow the file name to come from somewhere external to the script--such as text entered into a text field.

              • 4. Re: How do I name an email attachment?
                marco96

                Thanks Phil,

                It works great.