Index from Character Style

Viewing 14 reply threads
  • Author
    Posts
    • #93992
      Jack Cane
      Member

      For the last few d. I have had a running dialog n this subject with experts on the inDesign forum. Results have been less than satisfying. Hoping that one or more of you might be able help.

      I’m publishing a series of books containing selections from over 1,000 photos of orchids taken by me & my Leica over a ten-y. period in five countries on three continents. Two of those books are in print and the third is about to come out. The first volume contains a two-tier index based on orchid genera and their associated species, generated pretty much automatically (if I recall correctly) based on (I think) character styles associated with the genus and species, respectively. That was completed late in 2016 or early in 2017. Problem is, I failed adequately to document the procedures that I followed at the time, and I’m having a degree of difficulty reproducing them now.

      Current dialogs with experts on the inDesign forum are leading me to believe that I need to create each index entry manually from each instance of genus/species on every page in the book. My best recollection (?) is that I had access to a script that performed that search and generated the resulting index automatically, upon completion of the process of adding images and captions to the book. That is what I now need to reproduce, document and save for future re-use in this continuing series of books.

      Also on my ‘virtual horizon’ is a conceptual, multi-volume, cumulative index, containing entries for all volumes published to-date, and updated as each succeeding volume of orchid photos is published. I assume that my separate documents will therefore need to be combined into an inDesign, multi-volume ‘document’, that I have read about and need to learn more about, later on.

      Thanks in advance. Any assistance will be greatly appreciated.

      jwc

    • #93994
      David Blatner
      Keymaster

      There are other tools out there that help with indexing. The one you used might have been:
      https://www.indiscripts.com/category/projects/IndexMatic

    • #94021

      Jack,

      In your case, you need consulting!

      Maybe David has time to spend with you!

      Not me! … And I’m not really sure the guys who tried to help you on the InDesign Adobe forum would be glad to read your present comments if they don’t run, as others and me, on the main forums about ID!

      More people would need to seriously read the ID “help” giving by Adobe rather than spend time on forums to try to find someone to make their work for free!

      Boring! :(

      (^/)

      • #94111
        Masood Ahmad
        Participant

        Well, Obi… I don’t expect such a language here on the Forum.


        Maybe David has time to spend with you!

        Not me! …

        find someone to make their work for free!

        Boring! :(

        I mean who write such a language on a forum. People who place their queries here are often new and more likely they didn’t know how to do something. Of course, there is a detailed documentation from Adobe but sometimes that doesn’t suffice. There are book available in the market on every subject hence we still go to institute and Trainers to get some knowledge.

        Moreover, I have also noticed that you post your videos here in reply to other queries but never shared those scripts. To my experience you seems to be a new-bee who just stepped in the market to earn money. There are many qualified persons as members of this forum like Peter, Jongware, Keith, David, etc. I don’t recall they have ever spoken like that and have ever asked for a penny.

        If you don’t have time “Not me! … ” then why are you here. Don’t read “Boring! :(” stuff. No one is forcing you to read or reply any posts on this forum.

        Sorry @David, but I don’t encourage such talent.

      • #94117

        Aha!

        Don’t extract a sentence from its context and before making a comment, you’d better know what you’re talking about!!!

        Read this: https://forums.adobe.com/thread/2309776

        … I don’t care about your remarks about me!

        (^/)

    • #94051
      Peter Kahrel
      Participant

      Jack,

      There’s a script that you can use to add the content of character styles to the index:
      https://www.kahrel.plus.com/indesign/index_charstyles.html

      > I assume that my separate documents will therefore need to be combined into an inDesign, multi-volume ‘document’

      Correct. It’s called a book file. You can add individual InDesign documents to a book file, then add a separate document for the index, and have the index generated into that.

      Peter

      • #94224
        Jack Cane
        Member

        Peter,

        Thanks for your reply and those of several others, whose links I have saved but have not yet explored.

        I am just catching up on your and many other replies on this thread, some of which were relayed to me the junk folder of my eMail, and others not, all very confusing. Despite my having added this forum’s ‘from’ address to my ‘contacts, inDesign Secrets thread responses keep going to my eMail junk folder. So OK, going forward I’ll try to stay current by staying logged onto this thread itself.

        Best,

        jwc

      • #94232
        Jack Cane
        Member

        Peter,

        Yes, your work looks like it (1) will be very useful, and (2) is either an extension of or a predecessor to the script that I posted about 7 am this morning, 05-04. I also note the same name (Martin Fischer) in your references as well as in that of Obi Wan at 9 am this morning, 05-04. Looks like we are talking about the same basic implementation. I just downloaded the script, thanks.

        Question remains: how and where does one run the script from within inDesign? Probably a ‘Run’ button somewhere? Forgive me, have a LOT on my plate, juggling priorities, etc.

      • #94235
        Peter Kahrel
        Participant

        This page explains where to place a script and how to run it: https://www.kahrel.plus.com/indesign/script-info.html

        These two sections are relevant for you:

        The Script folder
        Running a script

        P.

      • #94290
        Jack Cane
        Member

        Peter,

        Finding the Scripts folder and running the script were completed successfully. Script worked flawlessly; many thanks.

        Now that the index is in place within my document, the last step will be to actually flow the index content onto that section of the document which I have reserved for the index to reside. Have looked around but have not found the workflow steps to make that happen.

        The scripts menu does contain a line-item called index_from_charstyles.txt, with a balloon note to the effect that “this file is not executable by any supported script language”. I do not know how that file got there; I don’t recall placing there myself; not sure it matters, just passing this along,FYI.

        Any ideas appreciated.

        jwc

      • #94293
        Peter Kahrel
        Participant

        Here’s an outline of InDesign’s index feature:

        https://helpx.adobe.com/indesign/using/creating-index.html

        It has a section ‘Generate an index’, you can look for that, but reading the whole article is probably useful.

        > The scripts menu does contain a line-item called index_from_charstyles.txt

        It’s a small text file written by the script to store the settings of the script’s dialog. Next time you run the script those data are placed in the dialog.

        P.

      • #94332
        Jack Cane
        Member

        Peter,

        I successfully loaded index_from_charstyles.jsx into my document, and ran it with mixed results (about which more later). Have now added your old script, IndexFmCharStyle.js. Running that now.

        Ths ‘incomplete’ posting is an update to an earlier one in which I reported a difficulty that had since been resolved. More to follow.

      • #94341
        Jack Cane
        Member

        index_from_charstyles.jsx appears to have completed successfully.

        I ran it three times: (1) for top-level (genus) and replacing the old index; (2) for species and (3) for hybrid, the latter bring equivalent to ‘species in ranking within the index, i.e. both are equal-ranking subitems of the index.

        Now (again!) I need to flow the index onto the right page(s) of my book. Still unsure of that workflow item. The first time I ran the same text about 24 h. ago, the index did flow onto the book content, but all entries were not correctly formatted. I have not yet seen ability/workflow in which to control or apply the formatting of index entries.

        But as I say, now the index does not appear ‘at all times’. I’m sure I’m doing something inconsistently or incorrectly; at one point I did see the entire index as a preview (balloon) adjacent to the mouse cursor. But now I’m not seeing that.

        Any ideas appreciated.

        jwc

      • #94361
        Peter Kahrel
        Participant

        > Have now added your old script, IndexFmCharStyle.js

        That’s not my script, it’s Martin Fischer’s. The two scripts do more or less the same, though by the looks of it, Martin’s script doesn’t do subtopics. Use only one of the scripts. If you want to do subtopics (genera/species), reflecting style groups, you’re stuck with mine.

        To update an index, do the same as generating one, but click ‘Replace existing index’ in InDesign’s ‘Generate Index’ dialog.

        As to formatting, you can format page numbers (e.g. to indicate principal references); see the article linked above. The entries themselves you can’t format directly. For instance, to apply italic to certain topic names you’ll have to use a rounabout way. There is a good workaround using GREP styles, see e.g. https://creativepro.com/formatting-in-indesign-index-entries.php

      • #94435
        Jack Cane
        Member

        OK, thanks, have eliminated Martin’s script from my scripts folder.

        After reading the content of the above link, I have concluded that it does not address my needs, which do not require altering the formatting of text within any given index entry. I only want to format the index entry to begin with. That should be the default, text format of my document.

        What I found, however, on first indexing my document, was that no formatting whatever had been applied.

        On attempting to RE-generate the index after receiving your further guidance, I performed the following steps, in order:

        — Generate new index (replace old) based on first-level topics (genus);
        — Regenerate index (without replacing old) based on first, second-level topics (species);
        — Regenerate index (without replacing old) based on second, second-level topics (hybrid);

        That seems to have succeeded, but the index appears not to be generated, i.e., there is no “preview balloon” content at the mouse cursor, as there was in my earlier attempts to generate the index, which succeeded, but resulted an unformatted, incomplete set of entries in the index.

        I’ll continue to investigate/pursue this, but wanted to provide this update in case you can find a way to improve/adjust the workflow.

      • #94441
        David Blatner
        Keymaster

        Jack, did you ever investigate Indexmatic?
        https://www.indiscripts.com/category/projects/IndexMatic

        It’s going to be hard to get a script (or even a commercial tool) to give you exactly what you want without custom work, which should involve a fee to the coder.

      • #94445
        Jack Cane
        Member

        No, David, not yet, b/c I (think I) have a history of successful, prior use of an existing script. I’m reluctant to start from scratch until/unless I’m forced to do so. If Peter and I cannot find a way to resolve this issue soon, then yes, I’ll have a look at IndexMatic.

        I still think there may be some underlying issue with the way I’m trying to run Peter’s existing script.

        BTW, FYI, for some reason my eMail server has begun to reject direct replies to ‘[email protected]’.

        Best,

        jwc

      • #94447

        Hi Jack,

        From what I read and understand,

        “A typical caption reads ‘ A – Phalaenopsis equestris, Atlanta Botanical Garden’, where only the first and second words after ‘A – ‘, which are the genus and species in this case, are to be indexed. I have defined separate character styles for genus and species, and am hoping for a script-based solution to implement this.” [your comment°]

        … you have applied 2 char styles to 2 groups of words: “genus” and “species”!

        Right?

      • #94448
        Jack Cane
        Member

        Yes, that is correct.

      • #94449

        So let me 5 minutes to try Peter’s script!

      • #94450
        Jack Cane
        Member

        Thanks in advance, very helpful.

      • #94451

        Sorry! It takes me more time!

        Peter’s script is very cool in its last version, but it doesn’t seem to work for you!

        What I seem to understand [sorry, but it’s really not easy! ;-) ] is that you have 2 groups, “Genus” and “Species”,

        In the index, “Genus” will be the first level, “Species”, the second”!

        So, here’ a sample to be clear:

        Country // city

        Your text is:

        United States of America. New York
        United States of America. Washington
        United States of America. Atlanta
        England. London
        France. Paris
        Spain. Madrid

        So, if I understand well, your index will be:

        United States of America
        New York
        Washington
        Atlanta
        England
        London
        France
        Paris
        Spain
        Madrid

        Right or wrong?

      • #94455

        The indents have been lost!!

        In fact, we have:

        United States of America —- Index Level 1
        New York —- Index Level 2
        Washington —- Index Level 2
        Atlanta —- Index Level 2
        England —- Index Level 1
        London —- Index Level 2
        France —- Index Level 1
        Paris —- Index Level 2
        Spain —- Index Level 1
        Madrid —- Index Level 2

      • #94456

        … Of course, in the index: “Atlanta” before “New York”! … But, alas, USA at the last place! [in my sample] =D

        Atlanta with the amazing CreativePro Week, May 22-26! ;-)

      • #94468
        Jack Cane
        Member

        Yes if I understand you correctly, that is exactly what I am trying to create, indents included.

      • #94469

        How many genus have you in your book?

      • #94470
        Jack Cane
        Member

        Approximately 70 genera, but this number can change. Book remains a work in progress. Number of species/hybrids ranges between about 1 to 4, variable.

      • #94471
        Jack Cane
        Member

        There also could be several instances of a species, or of the word, ‘hybrid’.

        jwc

      • #94482

        Good morning Jack [… and to All too!],

        Could you give us the captions of the two first genera beginning by “A” and “B”? [for tests]

        Could you give us three samples of “hybrid” captions?

        Do you use a single document or several ones included in a “book” file?

        Thanks in advance!

      • #94562
        Jack Cane
        Member

        Here are captions for the top two genera (alphabetically), both beginning with ‘a’:
        A – Ansellia africana, ABG
        Angraecum longicalar, ABG

        (3) hybrids follow
        Paphiopedilum hybrid, ABG
        Phalaenopsis hybrid, ABG
        Next – Aliceara hybrid Pacific Nova ‘Butter Buds’, ABG

        Please note that all prefixes (A, L, Next, R, etc.) soon will go away, because I now realize that indexing cannot work unless captions are collocated with their respective images. The only remaining exceptions will be the front and back covers, which I believe I will be able to edit manually upon completion of the index.

    • #94139
      Peter Kahrel
      Participant

      Michel — You’re way out of line here. You have no cause to abuse Jack Cane and Masood Ahmad the way you did. I think you owe them an apology.

      Your rant about people trying to have other people do their work for free is misguided and hypocritical. Misguided because Jack was just looking for some guidance — he wasn’t asking anyone to do work for him; and hypocritical because you asked for and received a lot of support in Adobe’s scripting forum when you asked the forum regulars to evaluate your scripts without offering anything in return.

      Peter

    • #94161

      Peter,

      I won’t go into a polemic with you! You know enough how much I value you!

      But there will be no apology!

      I think you didn’t take time to read the thread on the Adobe ID forum.

      From Jack Cane, answering to Randy Hagan who helped him with very detailed and relevant comments [posts 4 – validated as “correct answer” /6/8]:

      Post 5: “Yes, perfect, Randy. Thanks …”

      Post 7: Thanks, very helpful … ”

      If you want to talk about incorrectness [no response from JC to Randy Hagan’s last post (of the thread too)] and hypocrisy [beginning of the current thread]:

      “For the last few days, I have had a running dialogue with the experts on [Adobe ID forum]. Results have been less than satisfying. Hoping that one or more of you might be able help.”

      “… less than satisfying …” !!

      Apparently, I am the only one to find this kind of comment “incorrect”! [maybe Randy too if I indicate him this link!!]

      Moreover, note I’m the only one to have been present on the 2 threads!

      (^/)

      ——————————-
      In French:

      Peter,
      Si vous pensez que le fait de m’avoir autant aidé m’enlève mon libre-arbitre, alors, je vous remercie de ne plus le faire.
      Cordialement,
      Michel

    • #94175
      Randy Hagan
      Member

      It’s been a while since I’ve been here. My primary contact with InDesign Secrets these days is reading Mike Rankin’s excellent InDesign Tip of the Week columns. But I’ve had a couple of people bring this forum thread to my attention to my attention and felt compelled to contribute. They saw someone essentially using my name in vain, and felt my reputation was being tarnished, if not trashed, in this forum thread.

      First, thank you Michel for defending me. Though it’s really not necessary. If you saw the slings and arrows we Adobe Community Professionals suffer on a constant basis, you’d realize that is is barely a flesh wound. Not even in Monty Python terms. I regularly get accused of being 1) an Adobe apologist 2) an idiot who doesn’t know what he’s talking about and 3) a slacker because I don’t fix Adobe so it lets users do what they want — even if they don’t know themselves what they want. Helping in user forums is often a rolling testament that no good deed goes unpunished.

      As an Adobe Community Professional, we’re expected to regularly scan Adobe’s user forums and provide expertise to folks with problems using their software. We do this as unpaid contributors, for nominal consideration and for the good of the user community.

      This is a long way from my previous work with Adobe as a software consultant. But I’m happy to provide it for the good of the cause. I make my living as an independent computer graphics trainer and consultant. It’s a marginal living, but I like what I do, and my clients appreciate what I do for them. I’ve been working with InDesign since it was introduced in 1999, and using PageMaker and InDesign for 15 years before that. Over more than 35 years as a publishing professional, I’ve had first-person experience in how these programs work — and don’t work — producing publications on deadline, produced all kinds of beautiful pieces off deadline, as well as all kinds of print and digital products. I know my experience is not unique here, but I’m confident that I can play in this league.

      Addressing my experience working with Jack, he had asked the same thing he’s asked here in the Adobe InDesign forum on April 29. I provided two responses to his questions the next day and a third on May 1. As Michel points out, Jack marked my answer to his questions as correct, and unfailingly provided positive feedback as I addressed each question he had. I worked diligently to take care of him, and spent just over 7 hours writing responses to his questions, providing screen captures to illustrate them and editing them so they clearly offered him step-by-step solutions to his issues. At the end of my third response, I told him I was going to sign off from the thread and wished him well in his publishing efforts.

      After all I did for him, and the feedback he offered while I helped him, I’m truly dismayed that he considered the results less than satisfying. That’s certainly not the way he expressed himself when I was working with him.

      I can only assume his resulting dissatisfaction came from me signing off from the discussion.

      Let me emphasize: I provide support to Adobe’s user forums for free, and I make my living helping clients with their Adobe software problems. And while I wouldn’t have expressed myself as sharply as Michel did, I’d be lying if I didn’t say the same thoughts didn’t occur to me. I don’t provide my clients 7 hours of free support before I turn on the clock, and it isn’t fair to my paying clients or myself for me to do it through Adobe’s forums. I’ve gotta make a living too.

      Jack, I’m sorry you feel dissatisfied with what you got from me. If you’d like, you may contact me through my LinkedIn profile and I’ll be happy to do everything I can to address all your needs at my contracted rate. There’s no obligation, of course.

      And in closing, please have mercy on the ACPs who offer their assistance on Adobe’s user forums. They’re offering their help out of the kindness of their hearts, and I can assure you that you’re getting far more from them than you’re paying for.

    • #94180

      Randy,

      Thanks!
      No comment!

      Michel (^/)

    • #94181
      Peter Kahrel
      Participant

      Michel — So all that Jack Cane said was that he found the results of the discussion in the other thread ‘less than satisfying’. You may find that expression less than tactful, or maybe a bit ungrateful, or just clumsily expressed. I still think that your responses to him and to Masood Ahmad were out of line. But let’s not bore the forum any longer with this disagreement.

      Peter

    • #94182

      We talk here about “lack of respect”, no words unfortunately said!

      Respect of Randy, his help and his work, respect of what I want to offer here and elsewhere, for free and not for free!

      Personally, it’s not the first time I read displaced comments from persons who speak falsely without knowing, as:

      “… To my experience you seem to be a new-bee who just stepped in the market to earn money! …”

      Just respect others and I’ll shut my mouth!

      (^/) :(

    • #94183
      David Blatner
      Keymaster

      People: I need to step in here and ask that you please take your discussion elsewhere. This is not helpful to anyone on these forums.

      Here are some rules I would ask you to please consider:

      • If someone says they are not happy, you are a volunteer and it is not your responsibility to fix their problem. If they say they are not satisfied, they are describing themselves, not you.
      • If you do not want to share a solution, please do not respond. If you have a solution that costs money, please be clear about that in your post.
      • We do allow people to talk about their own commercial solutions here, but only on occasion. If you do it too much, we will remove your posts.
      • Be polite and kind to each other.

      Most importantly: The philosophy of our community is: TOGETHER WE THRIVE. In other words, no one of us can succeed in our work or business without the help of others. So we must work together and help each other.

      However, we do not want anyone to feel that they are being taken advantage of.

      So again: You do not need to participate here, but if you do, please be helpful and kind.

    • #94186

      David,

      I agree!
      Note however Jack Cane didn’t come back here since he created this topic! …
      Maybe somebody elsewhere gave him what he asked!! = D

      (^/)

    • #94187
      Jack Cane
      Member

      I just read Randy’s comments of 03.v.02017. Randy, thanks for your careful responses, but why I’m ‘less than satisfied’ is because I would much prefer a script-based solution that would simply scoop up all items of a given (set of) style(s), and place those as entries and subentries in my index, after all images have been entered and captions created.

      After further searching my archives, I uncovered a script used my first book “Atlanta’s Orchids”, apparently successfully, which resulted in a two-tiered index of what is called, in botanical jargon, ‘genus’ and ‘species’.

      However, I (1) did not take good enough notes on what I did in the first book, (2) have an awful memory, and (3) have no idea how to implement that in my next and subsequent books.

      A typical caption reads ‘ A – Phalaenopsis equestris, Atlanta Botanical Garden’, where only the first and second words after ‘A – ‘, which are the genus and species in this case, are to be indexed. I have defined separate character styles for genus and species, and am hoping for a script-based solution to implement this.

      Randy, again please forgive me if I misread your responses on the inDesign forum, but they appeared, to me at least, to be pointed to the formatting of index entries themselves, rather than to the process of indexing text entries from the book.

      Would appreciate advice from any of you about how best to implement the above in my next book(s), or better yet, place it into a template that works across all books.

      Here is the script,just recovered from my archives:

      // IndexFromCharacterStyle_z_CS4.jsx
      //
      // ggf. mit Zoom auf fehlerhafte Fundstelle
      //
      var myErr = mySucc = 0;
      var myList = “”;
      var doc = app.activeDocument
      var myCharacterStyle = myDisplayDialog(doc);
      app.changeTextPreferences = NothingEnum.nothing;
      app.findTextPreferences = NothingEnum.nothing;

      app.findTextPreferences.appliedCharacterStyle = myCharacterStyle;
      var _index = ( doc.indexes.length == 0 )
      ? doc.indexes.add()
      : doc.indexes.firstItem();
      f = doc.findText()
      for( oneEntry = f.length-1; oneEntry > -1; oneEntry– ) {
      var _topic = null;
      _topic = _index.topics.itemByName( f[oneEntry].contents );
      if (_topic == null) {
      try {
      _topic = _index.topics.add( f[oneEntry].contents );
      }
      catch(e) {
      selectIt(f[oneEntry]);
      }
      }
      try {
      _topic.pageReferences.add( f[oneEntry], PageReferenceType.currentPage ) ;
      mySucc++;
      }
      catch(e) {
      myList += f[oneEntry].contents + “\r” ;
      myErr++;
      }
      }

      alert( “Das Ergebnis:\r” + mySucc + ” x erfolgreich\r” + myErr + ” x versagt:\r———–\r” + myList );

      function myDisplayDialog(doc){
      var myFieldWidth = 120;

      var myCharStyles = doc.characterStyles.everyItem().name;

      var myDialog = app.dialogs.add({name:”Index-Begriffe”});
      with(myDialog.dialogColumns.add()){
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:”Zeichenformat:”, minWidth:myFieldWidth});
      }
      with(dialogColumns.add()){
      var mySourceDropdown = dropdowns.add({stringList:myCharStyles, selectedIndex:myCharStyles.length-1});
      }
      }
      }
      var myResult = myDialog.show();
      if(myResult == true){
      var theCharStyle =myCharStyles[mySourceDropdown.selectedIndex];
      myDialog.destroy();
      }
      else{
      myDialog.destroy()
      exit();
      }
      return theCharStyle;
      }

      function selectIt( theObj )
      {
      var myZoom = 400;
      app.select(theObj,SelectionOptions.replaceWith);
      app.activeWindow.zoomPercentage = myZoom;

      // Option zum Abbruch, falls innerhalb einer Schleife aufgerufen
      var myChoice = confirm (‘Fundstelle fehlerhaft!\rWeiter?’ );
      if (myChoice == false)
      exit();
      return app.selection[0];
      }

      Skript ist lauff?§hig in:
      InDesign Version CS3
      InDesign Version CS4
      InDesign Version CS5

    • #94204

      For memory, this script version is based on one written for ID CS3 in october 2007 by The Great Martin Fischer!
      … who modestly recognized 3 years later that its real father is … Master Peter Kahrel!

      (^/)

    • #94236

      All of these scripts won’t work as expected by Jack Cane if I clearly understood his request!
      [Just for comment!]

      [ link posted 9 hours ago on: https://forums.adobe.com/thread/2309776 ]

      (^/)

Viewing 14 reply threads
  • You must be logged in to reply to this topic.
>
Notice: We use cookies on our websites to give you a great online experience. If you keep browsing, we'll assume you're ok with this. For more information, see our privacy policy. By closing this banner, you agree to the use of cookies.I AGREENo