13 Replies Latest reply on Oct 4, 2011 8:42 AM by SuzeiQ

    Tagged Text in InDesign 5.5

    SuzeiQ

      I posted this in the general discussion and was pointed to scripting.

       

      I use tagged text in the files I place

      in InDesign. For example,

       

      <cn>This is the chapter number

       

      <ct>This is the chapter title

       

      <cst>This is the chapter subtitle

       

      <bt>This is the beginning of the body text

       

      <ah>This is an A-level head

       

                      and so on. In PageMaker, there was a checkbox in the "place"

      dialogue box named "Read tags." I checked that, and when I placed the file in the template (in which I had the styles defined), the whole chapter appeared with the formatting I wanted for each style. I could use anything I wanted for a text tag, as long as it was in <>. If it wasn't defined in the PM document, it came in in the basic style but could be formatted on the fly in PageMaker.

       

                      I can't find the equivalent checkbox in InDesign. I can't believe it is no longer there, but I can't find it. There is a lot online about exporting tagged text, but where, oh where, is my checkbox for placing tagged text? If someone knows where it is, I'd be very grateful. It seems that such a great (and incredibly easy) function shouldn't be gone.

       

      Thanks (and apologies to those who already saw this in the general discussion),

        • 1. Re: Tagged Text in InDesign 5.5
          L. Guy O'Rojo Level 2

          In CS4, there is a "Show Import Options" checkbox at the lower left of the import dialog box after you Cmd-D to place text. The tagged text file must contain some other information besides just the embedded stylename tags to be recognized as a tagged text file, so you'll have to read up on how to construct the tagged text file.

          • 2. Re: Tagged Text in InDesign 5.5
            John Hawkinson Level 5

            InDesign's user interface does not distinguish between an InDesign Tagged Text file and a normal text file. InDesign figures it out automatically on the basis of tagged-text headers at the top of the file.

             

            Export a sample story to tagged-text and copy the headers/tags.

             

            The format does not permit you to use arbitrary HTML/SGML/XML tags, as your example suggests. If you want to do that, you'll need to look at XML import, which is both more and less flexible, but also much harder to use. I recommend staying far away from XML, but it may be too late for that.

            • 3. Re: Tagged Text in InDesign 5.5
              SuzeiQ Level 1

              Thank you, all. It seems that a perfectly wonderful function from PageMaker has disappeared entirely in InDesign. How sad. Anyway, I will try exporting the file and seeing what the headers at the top of the file look like. It sounds kind of clunky, if I can’t define my own tags. But I will look into it. Right now, this is what I am doing:

               

                              Create tagged text file with all editing in place

               

                              “Place” in InDesign

               

                              Using the “Find” feature, search for each tag (e.g.  for extract) and replace with the paragraph format ext, which I’ve already defined in InDesign. It works quite well but is tedious. It seemed to me the perfect task for a script, and perhaps the GREP functionality is what I need. I will explore that.

               

               

               

              Another option I’ve used is to place the tagged text in PageMaker 6.5, which understands what I want and converts the tags to styles. I can then place that PageMaker file in InDesign and all the styles are in place. Unfortunately, the footnotes all become endnotes, which isn’t usually what I want. (And that is another problem I’m  dealing with – sometimes I want endnotes for a book; I know there is a script online for converting static endnotes to dynamic ones, but it is for one file. I’m using fifteen or twenty files in an InDesign “book” and want all the endnotes banked at the end of the book. But I digress . . . )

               

               

               

              Anyway, you’ve all given me places to explore. Any future advice would be more than welcomed. Thanks.

              • 4. Re: Tagged Text in InDesign 5.5
                John Hawkinson Level 5

                Well.

                I hope I don't regret this, but maybe you should try XML import.

                 

                I think it was probably an error for you to've been moved to the scripting forum, BTW, not that it's a big deal.

                 

                You can use the "Map Tags to Styles" command in the flyout menu of the structure pane. See Map XML tags to styles in the InDesign help for details.

                Note the "Map by Name" feature.

                 

                Otherwise, to use IDTT, you would have to markup your document as:

                 

                <ASCII-MAC>
                <Version:7><FeatureSet:InDesign-Roman>
                <pstyle:cn>This is the chapter number
                <pstyle:ct>This is the chapter title
                <pstyle:cst>This is the chapter subtitle
                <pstyle:bt>This is the beginning of the body text
                <pstyle:ah>This is an A-level head
                

                I guess that's maybe not so bad.

                 

                Using the “Find” feature, search for each tag (e.g.  for extract) and replace with the paragraph format ext, which I’ve already defined in InDesign. It works quite well but is tedious. It seemed to me the perfect task for a script, and perhaps the GREP functionality is what I need.

                Ugh.

                 

                Indeed, it cries out for automation. To be honest, I think the simplest automation would be to transform your existing file into a proper InDesign tagged Text file by search-and-replacing "<" with "<pstyle:". There are various ways to automate that, including via an InDesign script. What platform are you using?

                 

                We could certainly also automate the search-and-replace you mention. I think that's a silly way to do it if htere are built-in features that meet your needs, but perhaps there aren't (See above).

                 

                I don't think this is a good use of GREP styles, no. It would work, I guess, but you'd end up with character rather than paragraph styles, and there are some handwavy philosophical reasons that I think it would be a bad idea...

                 

                Anyhow, what do you think of the above options?

                • 5. Re: Tagged Text in InDesign 5.5
                  SuzeiQ Level 1

                  I am running InDesign CS5.5 on a Windows 7 operating system.

                   

                   

                   

                  I agree that I probably shouldn’t be in this forum. The last “scripting” activity I’ve done was creating and teaching courses on the use of macros in Word Perfect 5.1! I’m way over my head here. But hopefully I can learn, so thanks for bearing with me.

                   

                   

                   

                  I’ll spend today experimenting with the things you’ve mentioned. As is probably true with most InDesign users, I’m on deadlines for projects and don’t have nearly enough time to figure out how to do things the most efficient way. My move to InDesign was mandated, and I am also required to produce ePubs (after all, it is just pushing a button! – not!). Too much new learning, too little time.

                   

                   

                   

                  I contacted a local college that offers InDesign as an adult education course, but it deals only with producing ads and newsletters, not books or other documents with multiple files.

                   

                   

                   

                  Again, thanks for your patience. And sorry if this ends up posted twice. It bounced back as undeliverable.

                  • 6. Re: Tagged Text in InDesign 5.5
                    John Hawkinson Level 5

                    I agree that I probably shouldn’t be in this forum. The last “scripting” activity I’ve done was creating and teaching courses on the use of macros in Word Perfect 5.1! I’m way over my head here. But hopefully I can learn, so thanks for bearing with me.

                      

                    I’ll spend today experimenting with the things you’ve mentioned. As is probably true with most InDesign users, I’m on deadlines for projects and don’t have nearly enough time to figure out how to do things the most efficient way.

                    I defnitely don't mean to sound unwelcoming! And while it's true that I would have eventually seen your post in the general forum (I finally got to it last night), I did see your post here first...

                     

                    Please don't spend too much time experimenting and getting frustrated. That is, yes, please do try the above options, but please don't get to "I spent 4 hours trying to import the Tagged Text file and can't make it work! Help!". Ask for help after 30 minutes or so if you're stuck.

                     

                    People like to recommend lynda.com for video training resources. If you search Bob Levine's posts in the general forum he has a link with a free 7 day trial. Though I'd be surprised to find something that solves this exact problem.

                     

                    Windows? Hrmm. That does make it a little bit less convenient to automate the conversion from your markup to InDesign tagged text. Certainly not at the level of hard, but more at the level of "I'll wait for you to ask me to do it before I sit down and write it up."

                     

                    I see one post only. You can get the bounces if you inadvertantly reply to forums@adobe.com instead of jive-blahblah@mail.forums.adobe.com.

                    • 7. Re: Tagged Text in InDesign 5.5
                      SuzeiQ Level 1

                      Well, not quite four hours, but yes, I couldn’t get it to work. For one thing, I wasn’t sure about the header to use, since I’m on Windows. I used <ASCII-WIN>

                       

                      <Version:7><FeatureSet:InDesign-Roman>

                       

                      <pstyle:ah>

                       

                      <pstyle:ah_bib>

                       

                      <pstyle:bib>

                       

                      <pstyle:bh>

                       

                      <pstyle:bl>

                       

                      <pstyle:bl_ext>

                       

                      <pstyle:bt>

                       

                      <pstyle:bt_fl>

                       

                      <pstyle:cn>

                       

                      <pstyle:ct>

                       

                      <pstyle:cst>

                       

                      <pstyle:epi>

                       

                      <pstyle:epi_source>

                       

                      <pstyle:ext>

                       

                      <pstyle:ext_1stpara>

                       

                      <pstyle:ext_2dpara>

                       

                      <pstyle:fn>

                       

                      <pstyle:fn_2dpara>

                       

                      <pstyle:poem>

                       

                      <pstyle:poem_1st>

                       

                      <pstyle:poem_last>

                       

                       

                       

                      I added the above to one of my tagged text files and saved it from Word as .xml. When I brought it into InDesign, I got a sidebar with a couple of entries, one of which expanded to several “parts.” There was nothing in the template until I double clicked (I think that’s what I did; maybe right clicked) one of those sidebar items and placed the text. It came it as one long file with no returns and no formatting. The tags remained as text.

                       

                       

                       

                      I came back to the Internet and found an article by Peter Kahrel entitled “A GREP queries manager.” OK, I admit I didn’t understand much of it, but the notion of chaining queries sounds good.

                       

                       

                       

                      I did the Lynda.com tutorials when I was first ordered to make the change to InDesign (last month). I found them very helpful, but if they have anything on this, I missed it. Maybe I was too busy figuring out how to turn pages, find things on the pasteboard, and determine what character styles are and why I have to use them J

                       

                       

                       

                      “Not hard”? Um, what is the etiquette for asking you to do this task for me? I’m assuming that once I had a script in hand, I could add new paragraph styles by mimicking the entries. Is that right? Would it really be as easy as opening all the files and running the script to make the changes throughout? That sounds wonderful. Even running it on one at a time would be a great improvement. Do I need to contact you off list, and, if so, how?

                       

                       

                       

                      Thanks . . . yet again.

                      • 8. Re: Tagged Text in InDesign 5.5
                        John Hawkinson Level 5

                        Well, not quite four hours, but yes, I couldn’t get it to work. For one thing, I wasn’t sure about the header to use, since I’m on Windows.

                        Doesn't really matter.

                         

                        I used

                         

                        <ASCII-WIN>
                        <Version:7><FeatureSet:InDesign-Roman>
                        <pstyle:ah>
                        <pstyle:ah_bib>
                        <pstyle:bib>
                        <pstyle:bh>
                        

                         

                        Err, you have tags but nothing inside them. That doesn't make much sense. Shouldn't there be text in there? Makes it hard to test with!

                         

                         

                        I added the above to one of my tagged text files and saved it from Word as .xml. When I brought it into InDesign, I got a sidebar with a couple of entries, one of which expanded to several “parts.” There was nothing in the template until I double clicked (I think that’s what I did; maybe right clicked) one of those sidebar items and placed the text. It came it as one long file with no returns and no formatting. The tags remained as text.

                        No, no! XML is one thing. Tagged text is another! If you format it as tagged text, as above, you must save as .txt. That's your problem.

                         

                        “Not hard”? Um, what is the etiquette for asking you to do this task for me? I’m assuming that once I had a script in hand, I could add new paragraph styles by mimicking the entries. Is that right? Would it really be as easy as opening all the files and running the script to make the changes throughout? That sounds wonderful. Even running it on one at a time would be a great improvement. Do I need to contact you off list, and, if so, how?

                        Etiquette? Well, it beats me I think you have to convince me that it's worth it, and the best way to do that is to show me that the built-in solutions don't work for you. We're not there yet, and in fact, it doesn't sound like we're headed in that direction.

                         

                        Ideally any script would not need a hardcoded list of entries, so you shouldn't have to edit by mimicking. Though I suppose we could write it that way, but it would be silly.

                         

                        Off-list contact? Err, well, no. I would reserve that for people asking for paid advice. I don't think we're anywhere near there. In fact, I think we're

                        pretty close right now.

                         

                        We could talk more about how the XML step didn't work for you, but I think that way just leads to frustration, so let's focus on tagged text. To reiterate:

                        1. Post an example with actual content inside the tags (also, if you used >> Syntax Highlighting XML in the web interface, it will look much better. Alternatively, in the email interface, surround the tags with {code:xml} on both sides. And yes, I know your tags are not XML, but the forum interface likes to pretend.)

                        2. Call it .txt and not .xml.

                        • 9. Re: Tagged Text in InDesign 5.5
                          SuzeiQ Level 1

                          Many thanks, John.

                           

                          I thought I was supposed to list the tags used in the document at the beginning, not actually fill them with content. Sorry about that.

                           

                          Anyway, my problem is solved. Peter Kahrel wrote a script that does exactly what I need and that I can modify as I add tags.And it works on all open files, so I can do all the styles in a whole book at one double-click.

                           

                          So . . . on to new and wonderful learning in InDesign. Thank you all so much for your patience with a newbie. The "bad news" is that I may be back with more questions, since I'm really interesting in scripting, at least until InDesign makes some of these things I need part of the program (I'm thinking endnotes :-)).

                          • 10. Re: Tagged Text in InDesign 5.5
                            John Hawkinson Level 5

                            Hi, Susie:

                             

                                You should post a link to the script of Peter's so that people who find your thread can also find your solution!

                             

                                Though, again, any solution that involves editing the script to add tags doesn't sound like a very good solution to me. Much better to have the script just figure it out. But maybe I'm misunderstanding...

                             

                                It's definitely better to have more people interested in scripting than less. So welcome!

                            • 11. Re: Tagged Text in InDesign 5.5
                              SuzeiQ Level 1

                              Hi John,

                               

                               

                               

                              Peter wrote the script in response to an email I sent him. He has a wonderful site with lots of useful scripts for InDesign at

                               

                              http://www.kahrel.plus.com/indesignscripts.html

                               

                               

                               

                              I don’t know if he will add this one, which he just wrote, but it is definitely one that solves a lot of problems for me.

                               

                               

                               

                              I have a standard set of tags, and those are the ones in the script. Occasionally I get an oddball book that has a quirk that requires a tag I don’t have in the standard set. I can add and subtract those easily in the script editor.

                               

                               

                               

                              I don’t know much (read: anything) about scripting, but since I always enclose tags in <> and never use those characters for anything else in the files, it would probably be possible to pull out all the tags automatically from within the script itself. Is that what you mean? Then a quick old double-click would run on all the tags, regardless of what they were.

                               

                               

                               

                              Maybe trying to figure out how to do that should be my first scripting attempt. But in the meantime, I’m as happy as happy can be.

                               

                               

                               

                              Thanks.

                              • 12. Re: Tagged Text in InDesign 5.5
                                John Hawkinson Level 5

                                First of all, sorry for spelling your name wrong in post #10. It is not excusable!

                                 

                                 

                                Personally, I don't think it is OK to post a question and then go find a solution offline without making it available. In my view, the "social contract" of public forums is that people help others in exchange for the public good, and that means sharing solutions and answers. (It's why many people are deeply reluctant to assist with offline queries.)

                                I don’t know much (read: anything) about scripting, but since I always enclose tags in <> and never use those characters for anything else in the files, it would probably be possible to pull out all the tags automatically from within the script itself. Is that what you mean?

                                It is not at all what I mean.

                                Scripts execute arbitrary sequences of defined operations.

                                You appear to have a script that searches for a set of tags, and if it finds any of them, changed the paragraph style of the text between the tags and removes the tags.

                                 

                                I would propose that instead the script should look for text between angle brackets ("Anything that looks like a tag") and then apply a paragraph style based on what was in the brackets.

                                 

                                I suspect your first scripting attempt should be something a little simpler. But real-world has its advantages.

                                • 13. Re: Tagged Text in InDesign 5.5
                                  SuzeiQ Level 1

                                  There are indeed things that aren’t excusable, John, but I don’t number spelling my name wrong among them—especially when it is an odd spelling to begin with. And I’ve been called worse things than Susie.

                                   

                                   

                                   

                                  I seem to be stumbling all over this forum’s posting etiquette (I did read the notice when I signed on). I thought I did post the author’s website, but if not, it is

                                   

                                   

                                   

                                  http://www.kahrel.plus.com/indesignscripts.html

                                   

                                   

                                   

                                  There are many free InDesign scripts on his website, along with information on contacting him.

                                   

                                   

                                   

                                  I certainly don’t mean to offend anyone in this forum. You all know lots of things I need to learn—and learn quickly. J