Pagewise export of all text
Hi,
How to export all text as .txt or .rtf based on pagewise?
Regards
Hi,
How to export all text as .txt or .rtf based on pagewise?
Regards
Try this,
var myWindow = new Window ("dialog", "Export DOC");
myWindow.orientation = "row";
var myInputGroup = myWindow.add ("group");
myInputGroup.add ("statictext", undefined, "Enter your Page Number:");
var myPage = myInputGroup.add ("edittext", undefined, "");
myPage.characters = 10;
myPage.active = true;
var myButtonGroup = myWindow.add ("group");
myButtonGroup.orientation = "column";
myButtonGroup.add ("button", undefined, "OK");
myButtonGroup.add ("button", undefined, "Cancel");
var myResult = myWindow.show ();
if (myResult == 1)
{
for(i = 0; i < app.activeDocument.pages[Number(myPage.text)-1].textFrames.length; i++)
{
myFileName = "Page_" + myPage.text + "_" + i + ".rtf";
myFilePath = "/d/word_files/" + myFileName;
myFile = new File(myFilePath);
app.activeDocument.pages[Number(myPage.text)-1].textFrames.texts[0].exportFile(ExportFormat.RTF, myFile);
}
}
Vandy
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.