Hello All, I have document that has 10 text boxes (each on different page) and each box starts with parastyle H1 and then text and headings. The text boxes are independent.
I want to export the text as RTF for all textboxes whose text starts with H1 parastyle as separate files.
macos 10.8, CS6, extend script
PS: there are other pages having tables, figure but dont have text boxes.
Dear all, I am able to wrote script but sometimes it showed error at 5th line due to yet unknown reason. Is there any exception handling process in extend script?
var mydoc = app.activeDocument;
var myfolder = "~/Desktop/virender_mac_L/apple_script/testing";
for (var s=0; s< mydoc.stories.length; s++)
var st = mydoc.stories[s]; // var st = mydoc.stories[s].paragraphs;
if (st.paragraphs.appliedParagraphStyle.name == "H1") // here i use to get error once i few stories get exported but when i clicked on Run (two or three times) then remaining stories got also exported and alert("Done") got executed.
var fileName = s + st.paragraphs.contents + ".rtf";
myPath = myfolder + "/" + fileName;
myFile = new File (myPath);