4 Replies Latest reply on Aug 13, 2010 12:17 PM by Kasyan Servetsky

    Batch report of indesign docs

    talltim1 Level 1

      Hi,

       

      Does anyone know if there is a solution for this scenario:

       

      I have about 2,000 indesign documents and I need to insure that horizontal/verticle scaling is not applied to any of the text inside text boxes. Is there anything that can interegate a folder full of indesign files and create a report with that (and whatever else) information.

       

      Regards, Tim

        • 1. Re: Batch report of indesign docs
          Kasyan Servetsky Level 5

          Hi Tim,

           

          As far as I know, there's no such a script. But it can be written.

           

          Here is a sample script to get you started:

          tell application "Finder"
               set TheFolder to choose folder
               set TheFilelist to files in TheFolder whose name ends with ".indd"
          end tell
          
          
          tell application "Adobe InDesign CS3"
               set user interaction level of script preferences to never interact
               
               repeat with Doc in TheFilelist
                    tell application "Adobe InDesign CS3" to open Doc
                    set CurrentDocument to active document
                    tell CurrentDocument
                         set DocName to name
                         set ScaledText to (every text of every text frame whose horizontal scale is not 100 or vertical scale is not 100)
                         if (count ScaledText) is not equal to 0 then
                              set TheText to DocName & " - has " & ((count ScaledText) as string) & " scaled items" & return
                              my write_to_file(TheText, true)
                         end if
                         close saving no
                    end tell
               end repeat
               
               set user interaction level of script preferences to interact with all
               beep 3
               display dialog "Finished" giving up after 5
          end tell
          
          on write_to_file(this_data, append_data)
               try
                    set the log_file to (path to desktop as text) & "Scaled Text Report.txt" as text
                    set the open_target_file to open for access file log_file with write permission
                    if append_data is false then set eof of the open_target_file to 0
                    write this_data to the open_target_file starting at eof
                    close access the open_target_file
                    return true
               on error
                    try
                         close access file log_file
                    end try
                    return false
               end try
          end write_to_file
          

           

          I tested it on a bunch of very simple documents, so I'm not sure if it would work for you -- this is just an illustration of my idea.

           

          The script, at start, offers to choose a folder with indesign files. Then it opens every document, without showing errors (missing fonts, links, etc.), checks for scaled text, if it's found, it writes a line into Scaled Text Report.txt file created on the desktop, e.g.:

          SomeFile.indd - has 7 scaled items

           

          Finally it closes the document without saving

           

          Although I prefer JavaScript, for this script, I would chose AppleScript, because a single line can find all scaled text in a document:

          set ScaledText to (every text of every text frame whose horizontal scale is not 100 or vertical scale is not 100)

           

          BTW, you don't say which version of InDesign you are using, which platform you are on --  it's important to know.

           

          Regards,

          Kasyan

          1 person found this helpful
          • 2. Re: Batch report of indesign docs
            talltim1 Level 1

            Hi thanks for your help. I tried doing it through the book function in indesign and that worked... except now all my individual indesign pages start on page numbers they were in the book... and I need them all to start on page 1!... So now I need to find a script that will run through a folder of indesign files and make sure they begin with page 1.... see thread from other forum http://forums.adobe.com/message/3051537#3051537

             

            Regards, Tim

            • 3. Re: Batch report of indesign docs
              talltim1 Level 1

              Sorry Indesign CS4 6.0.3 and OSX 10.5.8

              • 4. Re: Batch report of indesign docs
                Kasyan Servetsky Level 5

                This script opens all documents in the selected folder and sets the first page to #1. Please test it before using it on your 2,000+ indesign documents.

                tell application "Finder"
                     set TheFolder to choose folder
                     set TheFilelist to files in TheFolder whose name ends with ".indd"
                end tell
                
                
                tell application "Adobe InDesign CS4"
                     set user interaction level of script preferences to never interact
                     
                     repeat with Doc in TheFilelist
                          tell application "Adobe InDesign CS4" to open Doc
                          set CurrentDocument to active document
                          tell CurrentDocument
                               set FirstPage to item 1 of pages
                               set TheSection to object reference of applied section of FirstPage
                               set page number start of TheSection to 1
                               close saving yes
                          end tell
                     end repeat
                     
                     set user interaction level of script preferences to interact with all
                     beep 3
                     display alert "Finished"
                end tell
                

                 

                Kasyan