Copy link to clipboard
Copied
My computer is a Mac, my default email client is Apple Mail and I am using the most recent version of Acrobat DC.
I have created an email script with app.mailMsg and the bUI parameter set to false. The body of the message sends a link for a Dropbox file represented by var link . The false parameter is ignored. The message is opened in Apple Mail, composed and ready to send, but requiring user
interaction. The variables in the script are all defined and the link works as intended when clicked in the message.
I need my message to send without user interaction and would appreciate insight / suggestions for accomplishing this. Here is my app.mailMsg script.
Copy link to clipboard
Copied
When the script is not executed from a privileged context (console, action, trusted function in a folder level script) the bUI false parameter is not honored and defaults to true.
Copy link to clipboard
Copied
When the script is not executed from a privileged context (console, action, trusted function in a folder level script) the bUI false parameter is not honored and defaults to true.
Copy link to clipboard
Copied
Thank you.
Copy link to clipboard
Copied
Well, although I'm sure this is the correct answer it's not working for me. I placed the script in a folder level trusted function with everything between app.beginPriv(); and app.endPriv(); but the result is the same, i.e., the script executes everything except actually sending the message without interaction. Therefore I am back to asking for insight as to why the mail message will not send without user interaction. My script has not otherwise changed.
Copy link to clipboard
Copied
Can you post your full folder level script and the script you using to call it, and where it is being called from?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
It worked for me. What happens when you run the following script in the console:
var mail="put the email address you want to send to here";
app.mailMsg(false, mail, "", "", "Test Email");
Copy link to clipboard
Copied
Copied and pasted from the Console:
var mail = "put the email address you want to send to here";
app.mailMsg(false, mail, "", "", "Test Email");
ReferenceError: mail is not defined
1:Console:Exec
undefined
Copy link to clipboard
Copied
You have to replace "put the email address you want to send to here" with an actual email address.
Copy link to clipboard
Copied
I did, but it returned the same error.
ReferenceError: mail is not defined
1:Console:Exec
undefined
Copy link to clipboard
Copied
Are running both lines of code?
Copy link to clipboard
Copied
Yes I am running both lines on the Console. Apologies that I keep repeating myself, but my code performs exactly as intended, except for the fact that it is not sending the mail message without user interaction. When I say it performs exactly as intended, I mean the email is composed with the correct email address in the "To" and "cc" fields, the email subject, and the body of the email, exactly as intended.
Also, I changed my default mail app from Apple Mail to Outlook. Again, the result is the same failure to send without user interaction but otherwise a properly composed mail message. I will be able to test this on a Windows computer over the weekend, in case the OS is the issue.
Copy link to clipboard
Copied
Yes, I understand all this. I'm trying to help you troubleshoot to see if the issue is with your trusted function by seeing if a simple email with a false bUI parameter will run from the console. But now we have a different issue. The console script is defining the variable mail, but then returning it as undefined in the next line.
After you run both lines of code again, try selecting only the word "mail" and running that. Does it still return undefined? Although it works for me, maybe it is a restricted variable. Try changing both instances of mail to mail_ and running both lines again. Now what is returned?