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);
}