How do I write a javascript code to open InDesign File, import Doc, save and export to pdf?

How do I write a javascript code to open InDesign File, import Doc, save and export to pdf?
Advertisement
Reply

Hi hasvi,
Need Template(.indt), textframes etc for the following script:
var myFolderInd = Folder.selectDialog();
var myFile = myFolderInd.getFiles("*indt");
app.open(myFile)
var myDoc = app.activeDocument;
var myDocName = myDoc.name;
var mySaveFile = app.activeDocument.save(myFolderInd.fsName + "/" + myDocName.split(".indt").join(".indd"));
var myFolderDoc = Folder.selectDialog();
var myFile1 = myFolderDoc.getFiles("*doc");
mySaveFile.pages[0].textFrames[0].place(File(myFile1))
//~ mySaveFile.place(File(myFile1))
app.activeDocument.textPreferences.smartTextReflow = true;
var myPDFFile = new File(mySaveFile.filePath + "/" + mySaveFile.name.split(".indd").join(".pdf"))
myDoc.exportFile(ExportFormat.PDF_TYPE, File("~/Desktop/abc.pdf"));
alert("Process Completed")
Regards
Siraj