4 Replies Latest reply on Aug 8, 2018 5:36 AM by CamiloU

    Help to remanufacture this script.

    camilo umana Level 1

      I have this idea: put the last line of every page in a (red) colour

       

      but somethings is failing and the instruction to «end repeat» is refused by the compiler.

       

       

      tell application id "com.adobe.inDesign"

        set pagina to document offset of active page of window 1

        set texto_marco_1 to text frame 1 of the active page of active window

        set s to swatch "Red" of active document

        set p to line 1 of paragraph -1 of texto_marco_1

      end tell

       

      Thanks

        • 1. Re: Help to remanufacture this script.
          greenrookie Level 3

          Hello Camilo,

           

          Try this, it works in CS6 for me.

           

           

          tell application id "com.adobe.inDesign"

                    set pagina to document offset of active page of window 1

                    set texto_marco_1 to text frame 1 of the active page of active window

                    set s to swatch "Red" of active document

                    set p to object reference of line 1 of paragraph -1 of texto_marco_1

                    repeat with x in p

                             set fill color of x to s

                    end repeat

          end tell

           

          gr

          • 2. Re: Help to remanufacture this script.
            CamiloU Level 1

            Hi, sorry for my long reply.

            I have been getting problems compiling the script.

             

            I will try in another app.

             

            Thanks,rockie probl.jpg

            • 3. Re: Help to remanufacture this script.
              S Hopkins Adobe Community Professional

              Try this. It works if there is one and only one text frame on each page.

               

              tell application "Adobe InDesign CC 2018"

                set docRef to document 1

                set redColor to swatch "C=15 M=100 Y=100 K=0" of docRef

                set pageCount to count of pages of docRef

                repeat with i from 1 to pageCount

                set thisPage to page i of docRef

                tell thisPage

                set bottomFrame to text frame 1

                set textRef to (a reference to line -1 of bottomFrame)

                set fill color of textRef to redColor

                end tell

                end repeat

              end tell

              • 4. Re: Help to remanufacture this script.
                CamiloU Level 1

                S Hopkins,

                 

                Yes, it is working on that condition: one frame por page.

                Thanks for your time.

                 

                Could not find the «green» button to apply solved.

                 

                C.