Skip to content

Instantly share code, notes, and snippets.

@ryanlfoster
Forked from kanemu/exportIdmlOrInx.jsx
Created May 6, 2013 20:09
Show Gist options
  • Save ryanlfoster/5527769 to your computer and use it in GitHub Desktop.
Save ryanlfoster/5527769 to your computer and use it in GitHub Desktop.
(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