5 Replies Latest reply on Jun 12, 2015 9:57 AM by Design Proj Dev

    Adobe Intro to Scripting PDF—script not working!

    Design Proj Dev Level 1

      As I try to follow the scripts in the Adobe Intro to Scripting PDF, the last line of the following script appears to have a run time error when I try to run it in InDesign CC 2014, but it did work in Illustrator CC 2014:

      app.documents.add()

      app.documents[0].layers.add()

      app.documents[0].layers[0].textFrames.add()

       

      Does this script not work in InDesign for some reason? If not, why not?

        • 1. Re: Adobe Intro to Scripting PDF—script not working!
          Design Proj Dev Level 1

          Also, this script from Adobe Intro to Scripting PDF is not working in InDesign CC 2014 either:

           

          var myDoc = app.documents.add(7, 10)

          var docHeight = myDoc.height

          var docWidth = myDoc.width

          myDoc.resizeCanvas((docHeight - 2), (docWidth - 2))

           

          The error coming back on the first line is:

          Invalid value for parameter 'showingWindow' of method 'add'. Expected Boolean, but received 7.

          • 2. Re: Adobe Intro to Scripting PDF—script not working!
            Vamitul Level 4

            Are you trying to run Illustrator scripts in Indesign?

             

            Those are two very different products with very different object models. Closest analogy i can find is you wondering why the wheels from your car don't fit a tank.

            • 3. Re: Adobe Intro to Scripting PDF—script not working!
              Design Proj Dev Level 1

              The first script I mentioned actually might be for Illustrator. I don't look at the ActionScript or Visual Basic sample scripts because that's not what I'm trying to learn. But it appears that, in some instances, reading those other versions may be the only way for me to know what application to use. They are not including app information in the JavaScript sample script.

               

              The ActionScript sample of this script specifically calls Illustrator, while the Visual Basic sample of this script specifically calls Photoshop. The JavaScript (ExtendScript) version of this script says nothing about which app to use, so could be Illustrator or Photoshop?

              • 4. Re: Adobe Intro to Scripting PDF—script not working!
                Vamitul Level 4

                Well, the scripting guide should tell you for what application does each script is meant for. If you are trying to learn, the try to read it fully, not just skim over what seems interesting.

                • 5. Re: Adobe Intro to Scripting PDF—script not working!
                  Design Proj Dev Level 1

                  I do read ALL of the general script information AND the JavaScript descriptions and scripts very carefully, but the app is not always mentioned in the general description or in the JavaScript description.

                   

                  I just find it very confusing to try to learn JavaScript AND to have to read the non-applicable AppleScript and Visual Basic just to find out what app the script might work with. I learn better if I keep the other scripting languages completely out of my sight and, therefore, brain.