Copy link to clipboard
Copied
I have this code and not able to make it work I have a PDF form that I would like to send an email to the email in the field ("Email"). However I do not want it as a PDF attachment, I would like to copy all the info in the PDF and paste into the email just like I see it on my screen. Here is my code:
var subject1 = "SSC Triage Assistance Request: " + this.getField("CID").value,
var address1 = this.getField("Email").value,
var body1 = this.getField("CID").value,
+ this.getField("Order").value,
+ this.getField("Container").value,
+ this.getField("Service").value,
+ this.getField("Date").value,
+ this.getField("Address").value,
+ this.getField("Server").value,
+ this.getField("Supervisor").value,
+ this.getField("Error").value,
+
"Due to an Order Entry error we are requesting your assistance with completing a manual move as noted below"\n +
+ this.getField("Superuser").value,
+ this.getField("Triage").value,
+ this.getField("Name").value,
+ this.getField("Phone").value,
+ this.getField("Placement").value,
+ this.getField("Facing").value,
+ this.getField("Gated").value,
+ this.getField("Code").value,
+ this.getField("Cross1").value,
+ this.getField("Cross2").value,
+ this.getField("Special").value;
event.target.submitForm({CURL:"mailto:" +address1 + :?Subject=" + subject1 + "&body=" + body1 +"",cSubmitAS:"PDF",cCharset:"utf-8:});
Any help would be greatly appreciated. Thank you in advance for any suggestions. I am brand new to scripting so dumb down any answers!
Then it might not work... Try this, though, as the last line of the code, instead of the submitForm command:
app.launchURL("mailto:" + address1 + "?subject=" + subject1 + "&body=" + body1);
Of course, that will not send the email, just create a Draft that the user has to then manually send.
Copy link to clipboard
Copied
I have this code and not able to make it work I have a PDF form that I would like to send an email to the email in the field ("Email"). However I do not want it as a PDF attachment, I would like to copy all the info in the PDF and paste into the email just like I see it on my screen. Here is my code:
var subject1 = "SSC Triage Assistance Request: " + this.getField("CID").value,
var address1 = this.getField("Email").value,
var body1 = this.getField("CID").value,
+ this.getField("Order").value,
+ this.getField("Container").value,
+ this.getField("Service").value,
+ this.getField("Date").value,
+ this.getField("Address").value,
+ this.getField("Server").value,
+ this.getField("Supervisor").value,
+ this.getField("Error").value,
+
"Due to an Order Entry error we are requesting your assistance with completing a manual move as noted below"\n +
+ this.getField("Superuser").value,
+ this.getField("Triage").value,
+ this.getField("Name").value,
+ this.getField("Phone").value,
+ this.getField("Placement").value,
+ this.getField("Facing").value,
+ this.getField("Gated").value,
+ this.getField("Code").value,
+ this.getField("Cross1").value,
+ this.getField("Cross2").value,
+ this.getField("Special").value;
event.target.submitForm({CURL:"mailto:" +address1 + :?Subject=" + subject1 + "&body=" + body1 +"",cSubmitAS:"PDF",cCharset:"utf-8:});
Any help would be greatly appreciated. Thank you in advance for any suggestions. I am brand new to scripting so dumb down any answers!
Then it might not work... Try this, though, as the last line of the code, instead of the submitForm command:
app.launchURL("mailto:" + address1 + "?subject=" + subject1 + "&body=" + body1);
Of course, that will not send the email, just create a Draft that the user has to then manually send.
Copy link to clipboard
Copied
Is this file going to be used in Acrobat only, or also in the free Reader? If Acrobat only then you should use the mailMsg method of the app object. If in Reader then it's more complicated. Basically you can only do it using the launchURL method and a "mailto" command, but it has a length limit, so it might not work correctly.
Copy link to clipboard
Copied
This PDF will be used on Adobe Acrobat Reader DC
Copy link to clipboard
Copied
Then it might not work... Try this, though, as the last line of the code, instead of the submitForm command:
app.launchURL("mailto:" + address1 + "?subject=" + subject1 + "&body=" + body1);
Of course, that will not send the email, just create a Draft that the user has to then manually send.
Copy link to clipboard
Copied
I am getting an error here:
var body1 = this.getField("CID").value,
It says SyntaxError: missing variable name
2: at line 3
Copy link to clipboard
Copied
You've got a three types of errors in the code. Mainly that commas are not line endings.
First, Replace the comma at the end of the statement lines with a ";" This is one of your syntax errors
Next, remove all the commas at the end of the text lines that are used in the string concatenation.
Make sure you know what the end of statement line means as opposed to the end of a text line.
Next, on this line,
"Due to an Order Entry error we are requesting your assistance with completing a manual move as noted below"\n +
move the \n into the quotes.
And finally, the submitForm() function submits a form. This is what it does, so it will always produce an email with an attachment.
Copy link to clipboard
Copied
OK, so I got all that info corrected however when I click on it, it doesnt do anything? Any suggestions?
Copy link to clipboard
Copied
Run the script from the Acrobat Console Window so you can check on all the results as they happen.
Copy link to clipboard
Copied
I am so lost with this!!! Is there a way I can upload my form or send it somewhere for someone to check it out for me?
Copy link to clipboard
Copied
You've already uploaded your script. Now you've corrected it, please upload it again. This process goes on and on, even for experienced programmers, so you've probably still got some errors.
First though RUN IT FROM THE JAVASCRIPT WINDOW. If you are having problems doing this, let us know. We would much rather help you problem solve than read your code.
Copy link to clipboard
Copied
You'll find a video tutorial here on using the JavaScript Console Window.
Free Video Content & Full Listing of Available Videos