-
Notifications
You must be signed in to change notification settings - Fork 33
/
set-om-location.jsx
38 lines (34 loc) · 978 Bytes
/
set-om-location.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* Set the output file for all outputmodules for all items in the renderque
* @return {[type]} [description]
*/
var main = function() {
var p = app.project;
var rq = p.renderQueue;
var targetFolder = Folder.selectDialog('Select your outputfolder');
if (targetFolder === null) {
return;
}
app.beginUndoGroup('Set OM output location');
for (var i = 1; i < rq.numItems + 1; i++) {
var n = rq.item(i).comp.name;
n = n.replace(new RegExp('\.jpg'), '');
for (var j = 1; j < rq.item(i).numOutputModules + 1; j++) {
var om = rq.item(i).outputModule(j);
var path = targetFolder.fsName + '/' + n + '_[#####].tif';
$.writeln(path);
om.file = File(path);
}
}
app.endUndoGroup();
return 0;
};
var run = function(func) {
if (parseInt(app.version, 10) < 13) {
alert('This script is written for AE CC 2014\n Could also work in older versions');
return func();
// return;
}
return func();
};
run(main);