0

我在 adobe acrobat 文档中尝试了以下示例(请参见下面的代码)。但是,它永远不会到达“结束工作代码”行。登录后,global.FileCnt 始终未定义。这是为什么?它不应该由所选的pdf总数填充吗?我错过了什么吗?

// Begin Job
if (typeof global.counter == "undefined") {
    console.println("Begin Job Code");
    global.counter = 0;
    // insert beginJob code here
}
// Main Code to process each of the selected files
try {
    global.counter++
        console.println("Processing File #" + global.counter);
    // insert batch code here.
} catch (e) {
    console.println("Batch aborted on run #" + global.counter);
    delete global.counter; // so we can try again, and avoid End Job code
    event.rc = false; // abort batch
}
// End Job
if (global.counter == global.FileCnt) {
    console.println("End Job Code");
    // insert endJob code here
    // may have to remove any global variables used in case user wants to run
    // another batch sequence using the same variables, for example...
    delete global.counter;
}

谢谢!

4

1 回答 1

0

So, it turned out, I need to run two batch sequences for this to achieve.

1st script - for populating value for global.FileCnt 2nd script - do the process

https://forums.adobe.com/thread/1851796

于 2015-06-03T16:33:05.727 回答