1 Reply Latest reply on Feb 24, 2012 1:27 PM by Muppet Mark

    scripting label in InDesign CS5 vs CS4

    dave_reinhold

      I have read through a few (several) of the posts and am not finding info that I understand to help me with this specific problem.

       

      I am editing a script that was written by another person several years ago and struggling to get it to work with InDesign CS5. The error I get seems to point to this bit of code that I believe creates a list from "labeled" text boxes in my documents. These boxes are later targeted and the content of them is changed based on the user's selection. As I understand it, the method or referring to these labels has changed in CS5, but the examples I have seen are all javascript or something other than Applee Script as far as I could tell.

       

       

      --create references to Pass check boxes

      try

          set passTextFrames to every text frame of all page items whose label is "Pass Text Frame"

      on error

          display dialog "There is no labeled box in this document. Please click on the Cancel button, then place a slug from the slug library and re-run the script." buttons {"Cancel"} default button 1

      end try

             

       

       

      Later the code used to change the content of these frames is:

       

      repeat with aPassFrame in passTextFrames
      set contents of paragraph 1 of aPassFrame to "SECOND PASS"
      end repeat

       

       

      Thanks for any help you can offer!

        • 1. Re: scripting label in InDesign CS5 vs CS4
          Muppet Mark Level 5

          tell application "Adobe InDesign CS5"

                    tell the active document

                              try

                                        set passTextFrames to every text frame whose label is "Pass Text Frame"

                              on error

                                        display dialog "There is no labeled box in this document. ¬

                                        Please click on the Cancel button, then place a slug from the slug library ¬

                                        and re-run the script." buttons {"Cancel"} default button 1

                              end try

                    end tell

          end tell