Hi! For a TOC I started writing a script: var myBook = app.books[0], myContents = myBook.bookContents.everyItem(), inhaltSeite = myBook.bookContents.firstItem(), //myPageRange = mContents.documentPageRange, myFilePaths = myContents.fullName, AFormatGruppe = app.activeDocument.paragraphStyleGroups.itemByName('myGroup'), myChapterTitleStyleName = AFormatGruppe.paragraphStyles.itemByName('pStyle1'), myChapterSubtitleStyleName = AFormatGruppe.paragraphStyles.itemByName('pStyle2'), titleArray = [], subTitleArray = [], resultString = "", allPages= [], lastPages = []; myDoc = app.activeDocument, myObj = myDoc.selection[0], app.findChangeGrepOptions.includeFootnotes = true; app.findChangeGrepOptions.includeMasterPages = true; app.findChangeGrepOptions.includeHiddenLayers = true; app.findChangeGrepOptions.includeLockedLayersForFind = true; app.findChangeGrepOptions.includeLockedStoriesForFind = true; app.findGrepPreferences = NothingEnum.nothing; // Suchfeld leeren app.changeGrepPreferences = NothingEnum.nothing; // Ersetzen-Feld leeren for (var k = 0; k < myFilePaths.length; k++) app.open(File(myFilePaths ), false); app.findTextPreferences = null; app.findTextPreferences.appliedParagraphStyle = mChapterTitleStyleName; titleArray = app.findText(); for (var k = 0; k < myFilePaths.length; k++) alert(titleArray .contents); The chapters are documents in a book. "myChapterTitleStyleName" is the main chapter title and "myChapterSubtitleStyleName" a subline. I need them both. In the rows 18-22 I let the script search in hiddden layers, on masterpages, etc. But it find only the items on document-pages (nor on the master and neither on hidden layers). Where is the problem with it?
... View more