extendscript:获取Project的文件夹

时间:2015-10-22 07:41:11

标签: javascript extendscript after-effects

我想阅读当前Project的所有子文件夹。因为我的项目正在使用素材文件夹中的图像,所以我需要它的所有子文件夹。

现在我只拥有项目的当前路径:

 var projectPath=app.project.file.path;

1 个答案:

答案 0 :(得分:3)

您获得的项目路径:

def http = new HTTPBuilder(serviceEndPoint)
def scanResultFile = new File(testRunner.testCase.getPropertyValue("ScanResultFile"))

http.request( POST ){ req ->

    headers.'Connection' = 'Keep-Alive'
    headers.'User-Agent' = 'SoapUI 4.5.1'
    requestContentType = 'multipart/form-data'

    ByteArrayBody bin = new ByteArrayBody(scanResultFile.readBytes(), "application/octet-stream", "jobResult");
    StringBody info = new StringBody(testRunner.testCase.getPropertyValue("JsonScanResult"), "application/json", java.nio.charset.StandardCharsets.UTF_8);

    MultipartEntity entity = new MultipartEntity()
    entity.addPart("info", info);
    entity.addPart("jobResult", bin)
    req.entity = entity
}

你得到的所有递归文件夹:

app.project.file.parent