Skip to main content
February 24, 2012
Question

scripting label in InDesign CS5 vs CS4

  • February 24, 2012
  • 1 reply
  • 1159 views

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!

This topic has been closed for replies.

1 reply

Inspiring
February 24, 2012

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