9 Replies Latest reply on Jun 23, 2011 12:53 PM by John Hawkinson

    Creating a preview of an InCopy file, automatically

    Casey Jensen Level 3

      Are there any programs / utilities / scripts out there that will convert an icml file to a jpeg or pdf? I have some users who would like to have previews of incopy files in a system before they're attached to any sort of layout.

       

      I see that there's a native option within IC to export to a PDF, but haven't found any sort of scripting or utility to do this.

       

      Thanks!

        • 1. Re: Creating a preview of an InCopy file, automatically
          John Hawkinson Level 5

          Do you count scripts that use InCopy and InDesign? Because if not, you'l have quite a bit of difficulty.

           

          In order to produce an image, you need InCopy to parse the INDD file of the layout.

           

          If you just want the text, that is easy enough to extract with XSLT. You say previews, though, so it sounds like you want more than that...

           

          What's your use case?

          • 2. Re: Creating a preview of an InCopy file, automatically
            Casey Jensen Level 3

            Maybe not quite following you, but at this stage, there is no layout.

             

            There are just .icml files.

             

            The XSLT might be the way to go, however the text isn't tagged, so any styling information would be lost in a 'preview'. May not be a big deal, but it would be hard to differentiate between say a headline and the body text, other than having a paragraph break.

             

            Editors who are starting stories in InCopy. Higher ups want to be able to preview these stories/content long before they're attached to a layout. 

            • 3. Re: Creating a preview of an InCopy file, automatically
              John Hawkinson Level 5

              I think the pivotal question is this: is it OK to use a script that invokes InCopy to produce this preview, or is it necessary for you to be able to preview these files on machines that are not licensed for InCopy?

               

              The XSLT might be the way to go, however the text isn't tagged, so any styling information would be lost in a 'preview'.

              No, that's not the case. XSLT on the ICML file has full access to all applied styles. For instance, let's take a really simple document in InCopy:

              spain.png

              It has this sort of XML structure (with much omitted) in the ICML/IDML. Note that this is the native InCopy file, not what happens when you File > Export to XML (in InDesign) or InDesign Tagged Text or whatnot. ICML:

               

              <Story Self="uc8" StoryTitle="test" TrackChanges="false">
                <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/$ID/NormalParagraphStyle">
                  <CharacterStyleRange AppliedCharacterStyle=
                  "CharacterStyle/$ID/[No character style]">
                    <Content>The rain in </Content>
                  </CharacterStyleRange>
                  <CharacterStyleRange AppliedCharacterStyle=
                  "CharacterStyle/$ID/[No character style]" FontStyle=
                  "Bold">
                    <Content>Spain</Content>
                  </CharacterStyleRange>
                  <CharacterStyleRange AppliedCharacterStyle=
                  "CharacterStyle/$ID/[No character style]">
                    <Content> falls </Content>
                  </CharacterStyleRange>
                  <CharacterStyleRange AppliedCharacterStyle=
                  "CharacterStyle/$ID/[No character style]" PointSize=
                  "48" Underline="true">
                    <Content>mainly</Content>
                  </CharacterStyleRange>
                  <CharacterStyleRange AppliedCharacterStyle=
                  "CharacterStyle/$ID/[No character style]"
                  Underline="true">
                    <Content> on the plain.</Content>
                    <Br/>
                  </CharacterStyleRange>
                </ParagraphStyleRange>
              </Story>
              
              

               

              Editors who are starting stories in InCopy. Higher ups want to be able to preview these stories/content long before they're attached to a layout. 

              It's hard to imagine these higher-ups being satisfied without all the capabilities that editors have.

              • 4. Re: Creating a preview of an InCopy file, automatically
                Casey Jensen Level 3

                Thanks, that's good news, and would presumably work, then. But yes, an instance of InCopy could be utilized, if necessary. Is there another way you had in mind of accomplishing this?

                • 5. Re: Creating a preview of an InCopy file, automatically
                  John Hawkinson Level 5

                  Well, sure. The whole point of the above XML was to point out that you can use standard XML tools to extract the contents from ICML files without using InCopy or InDesign. It's a bit of a pain though.

                   

                  So, does the native PDF export from InCopy do what you want, and you just want to automate it? it's just 2 keypresses, right? What part do you want to automate? [Now I'll put my foot in my mouth for not having incopy in front of me right now and discovering it's not that simple...]

                  • 6. Re: Creating a preview of an InCopy file, automatically
                    Casey Jensen Level 3

                    Yes, it does. However, I'm talking for an entire staff, and on a consistent basis (every time a user checks back in an article). The icml files will be pulled from a database, so I wasn't looking for someone to babysit the files. It does look like there are some options in the Applescript suite to use, though.

                    • 7. Re: Creating a preview of an InCopy file, automatically
                      John Hawkinson Level 5

                      OK, I feel like we're very slowly teasing the question out of you.

                      You want a script to automatically run InCopy's Export to PDF option

                      every time a user checks in an article?

                       

                      Straight-up InCopy has beforeSafe and beforeClose events that you can

                      hook a script onto. But you mention a database (teasing again!), which one?

                       

                      For instance, Woodwing's Smart Connection defines additional events

                      like beforeSaveArticle.

                      1 person found this helpful
                      • 8. Re: Creating a preview of an InCopy file, automatically
                        Casey Jensen Level 3

                        It's K4, but there's metadata that's saved with the document in the database, so it wouldn't be a script that's run on client's machines. There would be a centralized machine that has a list of newly checked in files from the database, exports those articles to a directory, perhaps appending the filename with the metadata, or passing it to an AppleScript, if possible, and then running the AppleScript to do the export to a PDF.

                         

                        I'm getting somewhere on an AppleScript.

                         

                        Thanks for your help, again, John.

                        • 9. Re: Creating a preview of an InCopy file, automatically
                          John Hawkinson Level 5

                          I do feel obliged to point out that I think Adobe's EULA suggests you are not allowed to use InCopy in an automated fashion like that, and allegedly you should use InDesign server. Though I don't think you can open ICML files in InDesign without placing them, which is awkward.

                           

                          Anyhow, that aside. I personally find it kind of painful to do serious scripting in Applescript and would suggest you consider Javascript, but it's not really relevant to this. Anyhow, in JavaScript you can set app.activeWindow.viewTab = ViewTabs.LAYOUT_VIEW; I'd imagine the AS option is similarly named.