// Generated by CoffeeScript 1.7.1
#target "aftereffects";
var Aegif, aegif;

Aegif = (function() {
  function Aegif() {}

  Aegif.prototype.render = function() {
    var i, outputFiles, _i, _ref;
    outputFiles = [];
    for (i = _i = 1, _ref = app.project.renderQueue.numItems; 1 <= _ref ? _i <= _ref : _i >= _ref; i = 1 <= _ref ? ++_i : --_i) {
      if (app.project.renderQueue.items[i].status === RQItemStatus.QUEUED) {
        outputFiles.push(app.project.renderQueue.items[i]);
      }
    }
    app.project.renderQueue.render();
    return this.openInPhotoshop(outputFiles);
  };

  Aegif.prototype.openInPhotoshop = function(outputFiles) {
    var outputFile, _i, _len, _results;
    _results = [];
    for (_i = 0, _len = outputFiles.length; _i < _len; _i++) {
      outputFile = outputFiles[_i];
      _results.push(photoshop.open(new File(outputFile.outputModule(1).file)));
    }
    return _results;
  };

  return Aegif;

})();

aegif = new Aegif();

aegif.render();
