Your attempt to exporting to IDML is a fair one, but it contains a few mistakes!
First off, you should not use app.open -- this does what it says, it opens a previously saved file. You want to create a new file here; the parameter to in refers to the file that it will create. With your code, it would overwrite an existing file -- unless ID notices you already have it open and so complains about that. Not a statement I would be willing to test for correctness.
Second, you need to set its file extension correctly to .idml :)
A third, minor, point: the Folder object provides a handy shortcut to your Desktop folder.
var newDoc = new File(Folder.desktop+"/DataMerge_MMM.idml");
app.activeDocument.exportFile(ExportFormat.INDESIGN_MARKUP, newDoc);
I don't have a CS5 at hand, I tested with my CS6. If you get errors on "unknown properties" and their ilk, call back in the morning and I will see what I can do.
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/tongxinshuyu/article-51718-3.html
台湾人
这—次不教训米国
考虑去演戏吧