InDesign Scripting 如何退出应用程序(非文档)
我正在尝试自动化数据合并过程。这就是我所拥有的:
首先创建了一个工作数据合并脚本:
function main(){
mySnippet ();
myTeardown();
}
//<setup>
//<snippet>
function mySnippet(){
// automate datamerge
var myDocument = app.open(File("P:/RxCut/In Design Implementation/build/automate/automate.indd"));
var myDataSource = File("P:/RxCut/In Design Implementation/build/automate/automate.txt");
myDocument.dataMergeProperties.selectDataSource(myDataSource);
myDocument.dataMergeProperties.mergeRecords();
myDocument=myDocument.save("P:/RxCut/In Design Implementation/build/automate/AutomatedMerged.indd");
app.activeDocument.save(new File("P:/RxCut/In Design Implementation/build/automate/AutomatedMerged2.indd"));
myDocument.close();
}
//</snippet>
//<teardown>
function myTeardown(){
}
这按预期运行得很好!
然后必须编写一个 vbscript 来打开 InDesign 并运行上面的 jsx 脚本:
Set myInDesign = CreateObject("InDesign.Application.CS5")
Msgbox("This message from Vbscript")
myJavaScript = "C:\test2.jsx"
myInDesign.DoScript myJavaScript, 1246973031
现在,如果 CreateObject("InDesign.Application.CS5")
打开 InDesign 如何关闭它?
I'm trying to automate data merge process. Here's what I have:
First of all have created a working datamerge script:
function main(){
mySnippet ();
myTeardown();
}
//<setup>
//<snippet>
function mySnippet(){
// automate datamerge
var myDocument = app.open(File("P:/RxCut/In Design Implementation/build/automate/automate.indd"));
var myDataSource = File("P:/RxCut/In Design Implementation/build/automate/automate.txt");
myDocument.dataMergeProperties.selectDataSource(myDataSource);
myDocument.dataMergeProperties.mergeRecords();
myDocument=myDocument.save("P:/RxCut/In Design Implementation/build/automate/AutomatedMerged.indd");
app.activeDocument.save(new File("P:/RxCut/In Design Implementation/build/automate/AutomatedMerged2.indd"));
myDocument.close();
}
//</snippet>
//<teardown>
function myTeardown(){
}
This runs great as expected!
Then had to write a vbscript to open InDesign and run that jsx script above:
Set myInDesign = CreateObject("InDesign.Application.CS5")
Msgbox("This message from Vbscript")
myJavaScript = "C:\test2.jsx"
myInDesign.DoScript myJavaScript, 1246973031
Now if CreateObject("InDesign.Application.CS5")
opens InDesign how to close it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
就这么简单
打开
退出
easy as that
to open
to quit