Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Can conditional text be assigned "automatically"?

Return to Member Forum

  • Author
    Posts
    • #55678
      Roland
      Member

      I'm going to have to place lots of content from an Excel file into InDesign to make a catalog. No problem, as I've done it before, but here's the catch: an index will need to be made based off of certain keywords which aren't actually used in the printed document (completely made-up example: “star-shaped cookie” = product name used in the catalog, “cookie star-shaped” = index keywords).

      I think — but please correct me if I'm wrong! — I should be able to set the keywords to be conditional text, then once everything's in place I could run the indexing script (index brutal), turn off the condition that shows the keywords, and I'd be done.
      If I'm correct in this reasoning, I must ask: what's the easiest way to get the keywords to have a certain condition automatically? Cearly I can't go through over 1000 products and set their keywords to have a condition manually…

      Can it be done via GREP if I were to make the keywords the very first column perhaps?
      Or can I simply paste all content into one big table, select the column and set the condition on the column, then split the table where necessary?

    • #55679
      Roland
      Member

      Okay, I just did some testing, and selecting a column to set it to be conditional doesn't work. So I guess I'll have to use GREP instead.

      I'm not very good at GREP but here's what I've got so far:
      Find: (^w+t)|(^w+ w+t)
      Replace: $0
      The replaced text will then also get the condition applied.

      This works for one or two keywords followed by a tab, as long as I first convert the imported table to regular tab-delimited text.

      I'm sure there's a better way to go about this, but I think for someone who's GREP-challenged it's a good way to go about this. Still, any suggestions you can offer are welcome :)

    • #55681

      .. selecting a column to set it to be conditional doesn't work ..

      I take it you tried to 'hide' the entire column? Correct — that simply won't work. Conditional text works on text only.

      Your GREP is fine (*), but you should take care when adding the index entry. If the index entry is inside the condition, it will also be hidden at the moment you generate the index …

      (*) Except you probably also want to find the hyphen. In that case, use something like “^([w -]+)t”.

      Word — of all possibilities! — supports a great feature for indexing. You can feed it a word list, à la index brutal, to generate what's known as a concordance list. That is a 'dumb' list, not copy-edited, just listing each and every word found. (Generating an index programmatically and having a good index are two separate things.) In Word, you can set up the input file as a two-column table; in the first column, you would enter the term to search for (in your case, “cookie star-shaped”), and in the second column, you enter the exact term as it should appear in the index (in your case, “star-shaped cookie”). I use this to generate index markers for proper names: “Einstein” in the left, “Einstein, Albert (1879-1955)” in the right column.

      I suppose you could ask Marc Autret if he could add something similar to index brutal.

      Well, well. As usual, Marc already foresaw that! Read how to do this on his web page: “ENTRY LINES SYNTAX : SPECIAL OPERATOR” (https://marcautret.free.fr/geek…..rut/en.php)

    • #55685
      Roland
      Member

      Thanks for the reminder. I'll add the hyphen just in case :)

      I couldn't use index brutal last time I made the catalog for this client, as I had a list of words they wanted used but none were related to the actual products' “names”, so I had to do it manually (yay) but this time he put the index words in the Excel file so it'll be less of a hassle.

      I'll also make sure to check the index itself won't have any conditions applied to it. It wouldn't be the first time something went wrong with an order for that particular client (though so far it's always been their fault for signing off on something that contained errors) and I'd like this to go well the first time around :)

      On a slightly different note: I might have come up with a way to use plain text rather than tables. Using one Paragraph Style with tabs and Line Styles, and offsetting the Underlines and Strikethroughs in the Line Styles' associated Character Styles, you can quite easily create a table look-alike with alternating row colors. That way editing and working with conditional text will be a lot easier, and the GREP won't give problems (for me at least) due to tables. It's also easier than managing multiple table, row and cell styles.

    • #60080
      D Y T
      Participant

      I'm looking to do automatically tag words with a conditional text tag using a script instead of a grep find and replace.

      I would like the script to add a unicode character and attach a conditional text tag to it.

      to insert the chatacter I would use

      app.selection[0].insertionPoints[0].contents = String.fromCharCode(0x035A); // Unicode symbol

      but I don't know how to attach the conditional text tag to it.

      Any ideas?

Viewing 4 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads