3 Replies Latest reply on Aug 26, 2008 9:35 AM by (Dave_Saunders)

    Return value to selected text frame

    Seth McGraw Level 1
      I have my script running and the proper text frame selected. How can I simply write the value to the selected text frame. I can't figure out what the equivalent of document.write (to selected text frame) is.

      Also is there a glossary of terms or a list of keywords and commands for Javascript w/ InDesign CS3?
        • 1. Re: Return value to selected text frame
          Level 1
          To find the information you need, look at ExtendScript Toolkit's Help menu and activate the InDesign CS3 Object Model Viewer.

          To "write" text into a text frame, you have to set the value of a text object in the frame. For example:

          myFrame.insertionPoints[-1].contents = "Hello Ducky";

          Dave
          • 2. Re: Return value to selected text frame
            Seth McGraw Level 1
            does myFrame need to be defined as a var ?

            the script runs and even selects the text box that the value is to be entered, but I cant get anything to replace the text in the textbox. The object model viewer would be nice if I knew how to use it. It doesn't tell me anything.

            I've had 1 course and it was an extreme 3 day cram session. Terminology has me by the *&^%^.
            • 3. Re: Return value to selected text frame
              Level 1
              myFrame is a variable that is assumed to point at a text frame. Whether it is a local or global is up to you.

              The object model can be daunting. The problem is that it tells you everything but you want to know one particular thing.

              Have you read the introductory material that Ole wrote? If you can't find it on your computer, it should be on this page:

              http://www.adobe.com/products/indesign/scripting/index.html

              Dave