2 Replies Latest reply on Jun 18, 2014 7:58 AM by rob day

    View all script labels and find an object by its script label

    jaguar 0006 Level 1

      Hello,

      I have an InDesign document in which many objects get a script label. I know how to view and edit the script label of an object, but is it possible to:

      1 - See a list of all the script labels of the document (as can be done with the styles for example)?

      2 - Search an object in the document by its script label?

        • 1. Re: View all script labels and find an object by its script label
          Laubender Adobe Community Professional & MVP

          @jaguar 0006 – no. There is no panel for this in the Graphical User Interface (GUI) of InDesign. Also you cannot search for the specific contents of such a label.

           

          You need to script those features.

           

          There are several concepts of doing what you want.


          Building a palette with ScriptUI showing all labels in a scrollable list would be one. Together with a show function of a selected label in that list. The list could show other properties of a labeled page item like its Type, its Name, its ID-Number, the page its positioned on etc.pp.

           

          I'd search the web for such a script or ask at the Scripting Forum here:

          InDesign Scripting

           

          Uwe

          • 2. Re: View all script labels and find an object by its script label
            rob day Adobe Community Professional & MVP

            If you are using OSX this AppleScript displays a list of document labels:

             

             

            global labels

            set labels to []

             

            tell application "Adobe InDesign CS6"

                set x to every page item of active document

                repeat with i in x

                    if class of i is group then

                        my checkGroup(i)

                    else

                        my getLabel(i)

                    end if

                end repeat

                display dialog labels as string

            end tell

             

            on checkGroup(g)

                tell application "Adobe InDesign CS6"

                    set gi to all page items of g

                    repeat with a in gi

                        if class of a is group then

                            my checkGroup(a)

                        else

                            my getLabel(a)

                        end if

                    end repeat

                end tell

            end checkGroup

             

            on getLabel(pageitem)

                tell application "Adobe InDesign CS6"

                    if label of pageitem is not "" and label of pageitem is not in labels then

                        set labels to labels & label of pageitem

                    end if

                end tell

            end getLabel