3 Replies Latest reply on Feb 22, 2008 10:53 AM by Dirk Becker 

    [CS3 Java Script] InsertTextFile.jsx Error

    David Pitsford Level 1
      I am getting an error when I run this script.
      myDocument.pages.item(0).textFrames.add is not a function.

      Any ideas on why this is happening? Am I missing a plugin?

      Mahalo
      David
        • 1. Re: [CS3 Java Script] InsertTextFile.jsx Error
          Dirk Becker  Level 4
          InCopy is for editing text, I would assume (without checking) layout operations have been omitted from its scripting object model. If you want to change your layout, use InDesign.

          Dirk
          • 2. Re: [CS3 Java Script] InsertTextFile.jsx Error
            David Pitsford Level 1
            Thanks Dirk
            What is this script used for if InCopy doesn't have the ability to add textFrames?

            David
            • 3. Re: [CS3 Java Script] InsertTextFile.jsx Error
              Dirk Becker  Level 4
              The script is part of the scripting guide collection of example scripts - I found copies in the SDK and I think I downloaded a guide-samples archive which has another copy.

              As I'm having a first look at them at this moment, I think these scripts are more meant to illustrate specific commands/methods for reuse in your own scripts and supporting the scripting guide, rather than to be executed for a specific purpose.

              One indicator for this is that the file name is hard wired rather than using a choose-file dialog, and that path looks really PC-ish on my Mac.

              I agree though that this could have gone through more testing, and that the "//An InCopy CS3 JavaScript" comment is misleading while there is no hint about "experimental" state in the script. Probably we're both missing a note in some prominent place of the scripting guide. Please post a bug in the bug report page with your finding.

              Dirk