I know you can write an (if, then) command using applescript. Does anyone know if there is a way to tell automator to stop running a workflow if an applescript from within the workflow get's the proper response back from an (if, then) command. I'm having an applescript run some javascript form within automator. I posted both scripts below. If the response from the javascript result is "You do not have any items set to render.", I want the workflow to stop.
Applescript:
Javascript:
Applescript:
Code:
tell application "Adobe After Effects CS3"
set sScriptPath to "MacintoshHD:Applications:Adobe After Effects CS3:Scripts:render.jsx"
DoScriptFile alias sScriptPath
end tell
Javascript:
Code:
//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.");
}
var myQueue = app.project.renderQueue //creates a shortcut for RQ
// Call render
myQueue.render();