3 Replies Latest reply on Sep 26, 2012 12:36 PM by Muppet Mark

    Applescript Text Wrap ID CS5


      I'm switching from CS3 to CS5 and have most things working but cannot get text wrap mode to work.


      CS5, Mountain Lion


      tell application "Adobe InDesign CS5"

      tell document 1

      tell every text frame whose label is "set_wrap"

      set text wrap mode of text wrap preferences to bounding box text wrap

      set text wrap offset of text wrap preferences to {9, 1, 1, 1}

      end tell

      end tell


      I get an error -10006 Can't set text wrap mode of text wrap preferences of every text frame whose label =\"set_wrap\" to bounding box text wrap.


      If I look at the text wrap preferences they look "normal" except for the text wrap mode which is displayed as «class txtw». By normal I mean understandable english so anyone can read and understand the listing. The fact that the text wrap mode is different makes me think it either can't be addressed or needs to be addressed differently. Or that it is just broken under mountain lion.


      The lines referencing the text wrap preferences are taken directly from the scripting guide, and if I manually set the text frame to bounding box, the text offset does get set, so I'm addressing the frame correctly in that line at least.  What am I missing? Any help would be appreciated.





        • 1. Re: Applescript Text Wrap ID CS5
          -hans- Level 4



          ID CS5.5, OSX 10.7.4


          adding a missing 'end tell' your code works ;-)


          Are you really, really sure that your textframelabel is correctly set¿

          Try to add a count command to the list to see if it contains elements.


          Your error is given if trying to set properties to no item or empty list.


          Hans-Gerd Claßen

          • 2. Re: Applescript Text Wrap ID CS5
            Pikerfish Level 1

            I have checked and text frame label is set, it does let me change offsets when i address the text frame by the label. I will try setting text wrap on all text frames on the page and see if that works. I can workaround the problem by creating an object style with bounding box text wrap on and applying it. I can script creating a new object style, but i cant set text wrap mode in it via applescript either, though i seem to be able to set any other parameter. May just have to create object style on the template.


            Thanks for the help, anyway.

            • 3. Re: Applescript Text Wrap ID CS5
              Muppet Mark Level 5

              Ditto Hans, I tried here and all is fine except where NO text frames then your error…