```
{
// Smart Import.jsx
function SmartImport()
{
var scriptName = "Smart Import";
// Ask the user for a folder whose contents are to be imported.
var targetFolder = Folder.selectDialog("Import items from folder...");
if (targetFolder != null) {
// If no project open, create a new project to import the files into.
if (!app.project) {
app.newProject();
}
function processFile(theFile)
{
try {
// Create a variable containing ImportOptions.
var importOptions = new ImportOptions(theFile);
importSafeWithError(importOptions);
} catch (error) {
// Ignore errors.
}
}
function testForSequence(files)
{
var searcher = new RegExp("[0-9]+");
var movieFileSearcher = new RegExp("(mov|avi|mpg)$", "i");
var parseResults = new Array;
// Test that we have a sequence. Stop parsing after 10 files.
for (x = 0; (x < files.length) & x < 10; x++) {
var movieFileResult = movieFileSearcher.exec(files[x].name);
if (!movieFileResult) {
var currentResult = searcher.exec(files[x].name);
// Regular expressions return null if no match was found.
// Otherwise, they return an array with the following information:
// array[0] = the matched string.
// array[1..n] = the matched capturing parentheses.
if (currentResult) { // We have a match -- the string contains numbers.
// The match of those numbers is stored in the array[1].
// Take that number and save it into parseResults.
parseResults[parseResults.length] = currentResult[0];
} else {
parseResults[parseResults.length] = null;
}
} else {
parseResults[parseResults.length] = null;
}
}
// If all the files we just went through have a number in their file names,
// assume they are part of a sequence and return the first file.
var result = null;
for (i = 0; i < parseResults.length; ++i) {
if (parseResults[i]) {
if (!result) {
result = files[i];
}
} else {
// In this case, a file name did not contain a number.
result = null;
break;
}
}
return result;
}
function importSafeWithError(importOptions)
{
try {
app.project.importFile(importOptions);
} catch (error) {
alert(error.toString() + importOptions.file.fsName, scriptName);
}
}
function processFolder(theFolder)
{
// Get an array of files in the target folder.
var files = theFolder.getFiles();
// Test whether theFolder contains a sequence.
var sequenceStartFile = testForSequence(files);
// If it does contain a sequence, import the sequence,
if (sequenceStartFile) {
try {
// Create a variable containing ImportOptions.
var importOptions = new ImportOptions(sequenceStartFile);
importOptions.sequence = true;
// importOptions.forceAlphabetical = true; // Un-comment this if you want to force alpha order by default.
importSafeWithError(importOptions);
} catch (error) {
}
}
// Otherwise, import the files and recurse.
for (index in files) { // Go through the array and set each element to singleFile, then run the following.
if (files[index] instanceof File) {
if (!sequenceStartFile) { // If file is already part of a sequence, don't import it individually.
processFile(files[index]); // Calls the processFile function above.
}
}
if (files[index] instanceof Folder) {
processFolder(files[index]); // recursion
}
}
}
// Recursively examine that folder.
processFolder(targetFolder);
}
}
SmartImport();
}
```
- 脚本管理器
- 读取文件夹内文件
- 层层时间线偏移Sequencer.jsx
- 层层随机时间偏移
- 文字分离char_separate_1.3
- 分解文字 把一个文字层分成若干个文字层
- 快速导入Smart Import
- 查找与替换字符 Find and Replace Text.jsx
- 层改名Selected_Layers_Renamer.jsx
- 创建灯光为选择的三维层.jsx
- 创建摄像机为选择的三维图层.jsx
- 创建调节图层CreateTrimmedAdjustmentLayer.jsx
- 创建调节图层多个CreateSeveralTrimmedAdjustmentLayers.jsx
- 创建一个空物体到选择的层Add Parented Null to Selected Layers.jsx
- 文字分离DecomposeText
- 修改渲染输出文件位置Change Render Locations
- AE脚本读取txt文档并写入数组
- AE脚本把数组写入到txt文档中
- AE提取字幕脚本
- AE批量用txt内容替换字幕脚本