Scripting: importFile(ImportOptions) imports one file unless sequence is set (#475)

This commit is contained in:
MarekSpodBiedry
2026-10-09 21:12:22 +02:00
parent 30aaddf7c2
commit bca027de6a
2 changed files with 37 additions and 1 deletions
+4 -1
View File
@@ -1703,7 +1703,10 @@ Project.prototype = {
importFile: function (opts) {
var f = opts instanceof ImportOptions ? opts.file : opts;
if (!f) throw __err("importFile(): no file");
var r = __call("file.import", { paths: [__str(f)] });
var args = { paths: [__str(f)] };
// After Effects imports just the picked file unless ImportOptions.sequence is set.
if (opts instanceof ImportOptions) args.sequence = !!opts.sequence;
var r = __call("file.import", args);
if (r.errors && r.errors.length) throw __err(r.errors.join("; "));
return __item(r.items[0]);
},