Adobe InDesign中.jsx脚本执行.jsx脚本 [英] Adobe InDesign .jsx script execute .jsx script

查看:1241
本文介绍了Adobe InDesign中.jsx脚本执行.jsx脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

怎么能有我.jsx脚本?

How can I have my .jsx script when finished execute another .jsx script?

也许这将有助于了解什么,我试图做的:

Maybe this will help understand what I am trying to do:

// WebCard.jsx file

function mySnippet(){
    //<fragment>
    var myPageName, myFilePath, myFile;
    var myDocument = app.documents.item(0);
    var myBaseName = myDocument.name;
    for(var myCounter = 0; myCounter < myDocument.pages.length; myCounter++){
        myPageName = myDocument.pages.item(myCounter).name;
        app.jpegExportPreferences.jpegExportRange = ExportRangeOrAllPages.exportRange;
        app.jpegExportPreferences.resolution = 96;
       app.jpegExportPreferences.pageString = myPageName;  

          switch(myPageName) {
        case "1" : myPageName = "EN FRONT WebCard";
            docType = "Web/Web Cards" break;
        case "2" : myPageName = "EN BACK WebCard";
            docType = "Web/Web Cards" break;
        case "3" : myPageName = "ES FRONT WebCard";
            docType = "Web/Web Cards" break;
        case "4" : myPageName = "ES BACK WebCard";
            docType = "Web/Web Cards" break;

    }
        fileName = group + " " + myPageName + " " + date + ".jpg";

        myFilePath = dirPath + docType + "/" + fileName;
        myDocument.exportFile(ExportFormat.jpg, File(myFilePath), false);
    }
    //</fragment>
}
//</snippet>
                // execute PrintCard.jsx file


//<teardown>
function myTeardown(){
}
//</teardown>

希望有所帮助?

Hope that helps?

推荐答案

您可以轻松地包括将在地步,你包括它执行另外一个脚本:

You can easily include another script which will be executed at the point where you include it:

// ... Do something (will be executed before teardown script)


#include "../path/to/teardown/script.jsx" 
// the path can be absolute or relative.

这应该在InDesign工作从CS3以上。

This should work in InDesign from CS3 upwards.

这篇关于Adobe InDesign中.jsx脚本执行.jsx脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆