9 Replies Latest reply on Sep 21, 2009 5:26 AM by sstanleyau

    AS M Space

    rob day Adobe Community Professional & MVP

      I know I can use tab or return to set tabs or returns as content in a text field, but how do I set different white spaces or dashes—m space, n space, etc.

        • 1. Re: AS M Space
          [Jongware] Most Valuable Participant

          It depends on what you call 'a text field' -- and how you insert Tab and Return now.

           

          If you use "^r" and "^t", you must be talking about the Find & Replace strings. If so, you can use the same notation as in the ID user interface: ^> for an en space, ^_ for an em dash, ^= for an en dash. (Sorry, can't cough up em space at the mo'.)

           

          If you are using AS notation -- isn't that something like "hello" + newLine + "world"? -- and want to insert this as live text into ID documents, you might want to look for how to write Unicode characters. In JS, I can insert any UC character: "hello\u2014world" is an em dash. Em spaces are a bit more difficult. I think they have a UC code as well (and you could try that), but inside ID it's one of the SpecialCharacters. You cannot insert these right away in strings; I use (JS again)

           

          app.activeDocument.selection[0].insertionPoints[-1].contents = SpecialCharacter.EM_SPACE;

          • 2. Re: AS M Space
            rob day Adobe Community Professional & MVP

            I'm adding content—not search and replacing. Unicode strings compile as a variable and produce an error. Tab and return compile as keywords, I'm looking for the equivalent for dashes and spaces. I suppose I could insert some odd string and then do a search and replace with the em space

            • 3. Re: AS M Space
              sstanleyau Level 4

              You can easily get this information by putting the character in a frame and getting the contents via script. If you ask for the contents of more than one character, you'll get the Unicode equivalent; otherwise you'll get the enumeration if there is one.

              • 4. Re: AS M Space
                rob day Adobe Community Professional & MVP

                Thanks Shane, that's working for em and en dashes but not different spaces. If I run a get contents script on an em space is appears to be returning a normal space.

                • 5. Re: AS M Space
                  rob day Adobe Community Professional & MVP

                  Sorry, it's working if i put in just one character at a time. The key word for em space is Em space. Thanks

                  • 6. Re: AS M Space
                    sstanleyau Level 4

                    Keep in mind that if you're using 10.5 or later, you can also use the actual Unicode characters in your scripts. That gives you the ability to set them more than one character at a time.

                    • 7. Re: AS M Space
                      rob day Adobe Community Professional & MVP

                      But when I actually use the returned key word in my script it's not working.

                       

                       

                      set myEntry to myTitle & "," & En space & myDate  

                       

                      returns this:

                       

                       

                      Pretty Picture,«constant nSPcSEnS»1995

                      • 8. Re: AS M Space
                        sstanleyau Level 4

                        That's right -- you can only use the enumerations by themselves. What's happening is that AS, not ID, is doing the concatenating, and it does that by coercing all items to text.

                         

                        As I said, if you're using 10.5 or later, just use the Unicode value. Other wise, you'll have to set the contents of the story in separate steps.

                        • 9. Re: AS M Space
                          rob day Adobe Community Professional & MVP

                          Thanks, I'll keep that in mind— I'm still using 10.4.11. A placeholder string followed up by a find and replace is working as well.