8 Replies Latest reply on Nov 14, 2008 5:40 PM by sstanleyau

    [AS] Insert "column break" or "frame break"!?

      Does anyone know how I can add a column break and a frame break in at the end of some text in a script. I can add a return or a tab but even though "frame break" and "column break" appear to be recognized by apple script as reserved works and not variables or text, they get placed in InDesign as strings. So, I get:

      "some textframebreak"

      rather than "some text" <<frame break symbol>>

      If I try to get the ASCII character of a frame break symbol in an ID doc, it's just ASCII 134, the carriage return character.

      What's the secret? Thanks.
        • 1. Re: [AS] Insert "column break" or "frame break"!?
          Level 1
          To further confuse things:

          This works:

          set contents of insertion point -1 to "foo"
          set contents of insertion point -1 to column break

          But this doesn't:
          set contents of insertion point -1 to ("foo" & column break)

          Do frame and column breaks always have to be entered by themselves?!
          • 2. Re: [AS] Insert "column break" or "frame break"!?
            [Jongware] Most Valuable Participant
            "Contents" of a text item is defined as a string
            i OR
            one of the special characters ('SpecialCharacters enumeration').

            I guess that's because these two are totally unrelated. A text string can be seen as a series of ASCII (or rather, Unicode) characters; and it can be read as one. However, there is no provision in Unicode for InDesign's own special characters. (For some there is, such as bullet, copyright, en space; but ID uses the enumeration as shortcuts.)

            If you 'read' a text string containing one of the special characters, you don't get ("foo" & column break) returned, you get "foo[!?]", where the [!?] denotes either nothing, or a semi-logical character (i.e., a carriage return would make some sense), or some random placeholder.
            • 3. Re: [AS] Insert "column break" or "frame break"!?
              sstanleyau Level 4
              On 15/11/08 3:26 AM, "chris harges" <member@adobeforums.com> wrote:<br /><br />> But this doesn't:<br />> set contents of insertion point -1 to ("foo" & column break)<br />> <br />> Do frame and column breaks always have to be entered by themselves?!<br /><br />Yes. Your statement above is asking AppleScript to concatenate "foo" and<br />column break, and pass that to InDesign. But column break is an InDesign<br />thing, so the best AppleScript can do is turn it to something it knows, in<br />this case text.<br /><br />-- <br />Shane Stanley <sstanley@myriad-com.com.au>
              • 4. Re: [AS] Insert "column break" or "frame break"!?
                Level 1
                Hi Chris,

                By the way, there's an example script in the Scripting Guide that shows how to enter special characters (it's SpecialCharacters.applescript, and you can find it with the other scripting guide scripts at the InDesign scripting home page, as mentioned at the top of this forum).

                Thanks,

                Ole
                • 5. Re: [AS] Insert "column break" or "frame break"!?
                  L. Guy O'Rojo Level 2
                  Hi:<br /><br />I normally write out a tag file to the temporary items directory and immediately place it. This allows you to embed the special strings (eg, "<cpnt:Previous><cpnt:>") for continued from, or unicode characters (eg, non-breaking hyphen is "<0x2011>").<br /><br />To see what strings you need, create what you want in a doc and export the text as InDesign tags.<br /><br />egr
                  • 6. Re: [AS] Insert "column break" or "frame break"!?
                    Level 1
                    Ah ha! Thanks. It didn't occur to me that AS/InDesign would concatenate the string and the special character term.

                    Will the same thing happen if I try to combine a unicode character with a string as in:

                    set contents of insertion point -1 to "foo" & <2260>
                    • 7. Re: [AS] Insert "column break" or "frame break"!?
                      sstanleyau Level 4
                      On 15/11/08 11:50 AM, "chris harges" <member@adobeforums.com> wrote:<br /><br />> Will the same thing happen if I try to combine a unicode character with a<br />> string as in: <br />> <br />> set contents of insertion point -1 to "foo" & <2260><br /><br />Yes. If you're using OS X 10.5.x, you can do this:<br /><br />-- outside tell InDesign<br />set theChar to character id 8800 -- decimal equivalent of 2260 hex<br />...<br />set contents of insertion point -1 to "foo" & theChar<br /><br />If you're using an earlier version of the OS, you'll need to do something<br />like:<br /><br />-- outside tell InDesign<br />set theChar to «data utxt2260» as Unicode text<br />...<br />set contents of insertion point -1 to "foo" & theChar<br /><br />-- <br />Shane Stanley <sstanley@myriad-com.com.au>
                      • 8. Re: [AS] Insert "column break" or "frame break"!?
                        sstanleyau Level 4
                        Actually, my reply isn't strictly true. What you wrote will work, but only<br />on pre-OS X 10.5 systems. The reason is that InDesign recognises <2002><br />style codes only when they're in a non-Unicode string. In 10.5.x, all<br />strings are Unicode, so the codes never get recognised.<br /><br />Moreover, if your "foo" was in fact a variable, whether it worked or not<br />would depend on the class of text in it, so to be safe you'd want to add an<br />"as string" to make sure it wasn't Unicode.<br /><br />The whole <2002> thing is going to be useless in 10.5 and later, so my<br />advice is to start weaning yourself off it.<br /><br />-- <br />Shane Stanley <sstanley@myriad-com.com.au>