Render and Email script Problem
Posted: August 21st, 2013, 7:22 am
Hello,
i am having a weird issue when trying to customize the functionality of the default Render and Email script that ships with AE.
when i want to run this script file directly from within another script, say by clicking a button:
.exists returns true, so the file is being found. However, the javascript debugger will pop up the render and email.jsx saying "EmailSocket does not have a constructor". I tried various other things, including copying the entire render and email script into my own script file... which just gives me the same error when i run the function containing the email socket. So far, the only working option to run this script without getting an error is running it from the Run Script option within after effects. If i do so, i am receiving an email after rendering is done, so my settings i put into change email settings.jsx are correct. But now i am lost, because how can i implement the function of emailing upon render done? There is hardly any information about this and especially the code within the email_methods.jsx is like chinese to me, but apparently the "error" might be somewhere in there. Because writing a simple script that just sends an email directly using the email_methods.jsx returns similar error messages.
Hope someone can help me here.
btw, what am i actually trying to do: a customized render notifier that can notify several people at once about different, selectable aspects of a render progress. This needs to be implemented in my post production tools script.
Maybe a good starting point would be if i could find some kind of a small script that actually just sends an email with fixed specs when something happens (click of a button, for instance).
edit: and here just another example.
This one will also give me an error saying EmailSocket does not have a constructor.
i am having a weird issue when trying to customize the functionality of the default Render and Email script that ships with AE.
when i want to run this script file directly from within another script, say by clicking a button:
Code: Select all
StartRender.onClick = function () {
try{
var RenderScript = new File("Macintosh HD/Applications/Adobe After Effects CS5.5/Scripts/Render and Email.jsx");
alert(RenderScript.exists);
RenderScript.open("r");
eval(RenderScript.read());
RenderScript.close();
alert("done");
}catch(e){alert("Problem.\n" + e.toString());
}
}
Hope someone can help me here.
btw, what am i actually trying to do: a customized render notifier that can notify several people at once about different, selectable aspects of a render progress. This needs to be implemented in my post production tools script.
Maybe a good starting point would be if i could find some kind of a small script that actually just sends an email with fixed specs when something happens (click of a button, for instance).
edit: and here just another example.
Code: Select all
var scriptName = "Render and Email";
var settings = app.settings;
var emailCodeFile = new File("(support)/email_methods.jsx");
emailCodeFile.open("r");
eval(emailCodeFile.read());
emailCodeFile.close();
var myMessage = "Hello.\r\n\r\n";
try {
// Send the email.
var serverSetting = settings.getSetting("Email Settings", "Mail Server");
var fromSetting = settings.getSetting("Email Settings", "Reply-to Address");
var toSetting = settings.getSetting("Email Settings", "Render Report Recipient");
var authUser;
var authPass;
if (app.settings.haveSetting("Email Settings", "Auth User")) {
authUser = app.settings.getSetting("Email Settings", "Auth User");
}
if (app.settings.haveSetting("Email Settings", "Auth Pass")) {
authPass = app.settings.getSetting("Email Settings", "Auth Pass");
}
// Ack, can't delete settings...
if (authUser == "") {
authUser = null;
authPass = null;
}
var myMail = new EmailSocket(serverSetting);
if (!myMail.send(fromSetting, toSetting, "AE Render Completed", myMessage, authUser, authPass)) {
alert("Sending mail failed.", scriptName);
}
} catch (e) {
alert("Unable to send email.\n" + e.toString(), scriptName);
}