2 Replies Latest reply on May 14, 2015 10:36 AM by Masters2150

    Can someone help clean up my script?

    Masters2150

      First let me say, I am completely new to this. My supervisor asked me to start converting word forms to PDF, and add special features, such as auto generating emails after a digital signature.

       

      This is the script I have, copied and edited from Change subject line of email when submitting a form using Acrobat X Pro

       

      Here is my edited script:

       

      // Build the subject line text from several fields form fields

      substart = "Request for non-standard hardware for: "

      clientname = getField("name2").valueAsString;

      space = " "

      numsign = "##"

      reqidnum = getField("reqid").valueAsString;

      var subj_text = substart + clientname + space + numsign + reqidnum + numsign;

       

      // Send the email

      mailDoc({

          cTo: "supervisor@asdf.com",

          cSubject: subj_text,

          cMsg: "Body of email message goes here.",

      });

       

      So as you can tell, I'm not all that good. I had to use a variable to put a space in the subject line.

       

      Here is how the subject line looks like with the above script:

      Request for non-standard hardware for: John Smith ##123456##

       

      How can I clean this up so I don't just keep using variables? I know theres a way I just don't know how.

       

      Thanks