// Render and Notify v1.4 // September 2009 // based on Render, Increment Save and Notify v1.0 // based on Render, Increment Save and Shutdown v1.0 // based on Lloyd Alvarez's Render, Email, Increment Save and Shutdown v1.02 // Credit to Lloyd Alvarez and Chris Kelley // Modifications by Steffen (http://forums.mactalk.com.au/members/dotnet.html) and John Einselen (http://iaian7.com) // Version History // 1.4 -- fixed unsaved project issues // 1.3 -- updated script to use binLocation, and added Growl support. // 1.2 -- added simpler post-via-browser (by setting prowlPL = false) and text-to-speech options // 1.1 -- modified script to include prowlLocation, removed save routines, and added "say" command. // 1.0 -- slight adjustment from Chris Kelley's script, replaced shutdown routine with prowl notification call. { /////////////////////////USER VARIABLES/////////////////////////////////// // Choose type = "prowl" to use prowl.pl (requires prowl.pl and SSLeay installation) // Choose type = "growl" to use the growlnotify command line interface (requires installation) // type = "web" to send the push notification via web browser (opens new window) var type = "web"; var binLocation = "/usr/local/bin/"; // location of prowl.pl or growlnotify command line tools // Season these to taste... var apiKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; var appName = "Adobe After Effects C3"; // Owner application for Growl messages, must match an intalled application name var appString = "After Effects"; var eventString = "Render Finished"; var projectString = (app.project.file) ? unescape(app.project.file.name) : "unsaved" ; var noteString = "Project: "+projectString; var priority = "1"; // priority can be -2 to 2 // ...to build a suitable prowl command line: var prowlCommand = "prowl.pl -apikey=" + apiKey + " -application=\"" + appString + "\" -event=\"" + eventString + "\" -notification=\"" + noteString + "\" -priority=" + priority; var growlCommand = "growlnotify -n \""+appName+"\" -t \""+eventString+"\" -m \""+noteString+"\" -p "+priority+" -a \""+appName+"\""; var webAddress = "https://prowl.weks.net/publicapi/add?apikey="+apiKey+"&application="+escape(appString)+"&event="+escape(eventString)+"&description="+escape(noteString)+"&priority="+priority; // Turn text-to-speech on and off via true / false: var sayOutloud = true; var sayString = eventString+" . "+noteString; /////////////////////////////////////////////////////////////////////////// function isSecurityPrefSet() { var securitySetting = app.preferences.getPrefAsLong("Main Pref Section", "Pref_SCRIPTING_FILE_NETWORK_SECURITY"); return (securitySetting == 1); } var safeToRunScript = true; safeToRunScript = app.project != null; if (safeToRunScript) { //check the render queue and make certain at least one item is queued safeToRunScript = false; for (i = 1; i <= app.project.renderQueue.numItems; ++i) { if (app.project.renderQueue.item(i).status == RQItemStatus.QUEUED) { safeToRunScript = true; break; } } if (! safeToRunScript) { alert ("You do not have any items set to render."); } if (!isSecurityPrefSet()) { var prefWarning = "This script requires the scripting security preference to be set.\n" + "Go to the \"General\" panel of the application preferences and make sure " + "\"Allow Scripts to Write Files and Access Network\" is checked."; alert(prefWarning); safeToRunScript = false; } } if (safeToRunScript) { var myQueue = app.project.renderQueue //creates a shortcut for RQ // Call render myQueue.render(); // Now rendering is complete. if (type == "prowl") { system.callSystem(binLocation+prowlCommand); } else if (type == "growl") { system.callSystem(binLocation+growlCommand); } else { system.callSystem("open \""+webAddress+"\""); } if (sayOutloud) system.callSystem("say "+sayString); } } // CLOSE MAIN { // eof