Skip to content

Instantly share code, notes, and snippets.

@kanemu
Created July 12, 2011 16:11
Show Gist options
  • Save kanemu/1078304 to your computer and use it in GitHub Desktop.
Save kanemu/1078304 to your computer and use it in GitHub Desktop.
[indesign]開いているドキュメントをidmlかinxで保存
(function(){
var docs = app.documents;
if(docs.length===0)return;
for(var i=0,len=docs.length;i<len;i++){
var doc = docs[i];
var docPath = doc.fullName.absoluteURI;
if(parseInt(app.version) > 6){
var idmlFile = new File(docPath.split('.')[0]+'.idml');
doc.exportFile(ExportFormat.INDESIGN_MARKUP,idmlFile);
}else{
var idmlFile = new File(docPath.split('.')[0]+'.inx');
doc.exportFile(ExportFormat.INDESIGN_INTERCHANGE,idmlFile);
}
};
alert('OK');
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment