6 Replies Latest reply: Sep 6, 2012 11:28 PM by Bill joy RSS

    How create indesign using Java Script

    Bill joy Community Member

      I am new in indesign and want to create indesign application using JavaScript.

      When i use AppleScript to create Indesign Application i use this statement

       

      tell application "Adobe InDesign CS5.5"

      set myDocument to make document with properties

      end tell

       

      Indesign Application create sucessfully.

       

      How create Indesign Application using JavaScript ?

      or what is equivelent statement of ( tell application "Adobe InDesign CS5.5" ) in Java Script.

      There are some java scripting example given on forum or in sdk.These all example start with app.

      when I debug these java script using ExtendScript ToolKit 3.6 It give error on app (undefined app).I think this app ia application object.

       

      How create  indesign application object  app in javascript ?

       

      While this script run sucessfully when i put these script in C:\Program Files\Adobe\Adobe InDesign CS5.5\Scripts

       

      and to run these script use Scripts panel (choose Window > Utilities > Scripts), then double-click the script name in the Scripts panel in indesign application.But In this case first i start indesign application and then choose Window > Utilities > Scripts then double-click the script name in the Scripts panel.

       

      I want to create Indesign Application (instance) using JavaScript.When I run or (debug) my JavaScript in any javaScript tool like ExtendScript ToolKit 3.6 then Indesign application should start, like in Apple Script.

       

       

      Thanks

        • 1. Re: How create indesign using Java Script
          Vamitul Community Member

          add first line

          #target indesign

          • 2. Re: How create indesign using Java Script
            Bill joy Community Member

            Thanks Vamitul

            Sorry there was a mistake in my post i do not want to use ExtendScript ToolKit 3.6 to develop java script

            Is there is any window inbuild javascript tool like applescript editor inbuild with mac to create script.

            i want to create such java script, that i do not need to put my java script in

            C:\Documents and Settings\<username>\Application Data\Adobe\InDesign\Version 7.0\<locale>\Scripts

            and when i run my script then indesign application create(start).

            Like in applescript there is no need to put the script in  /Users/<username>/Library/Preferences /Adobe InDesign/Version 7.5/<locale>/Scripts

            Simply  create applescript  in apple script editor which is inbuild with mac, Indesign Application create(start) sucessfully.

            So How create  indesign application object  app in javascript ?

             

            Is there is any other method plz tell me ?

             

            Thanks

            • 3. Re: How create indesign using Java Script
              Vamitul Community Member

              short story.. NO!

               

              however, if you run the script from ESTK, you don't need to copy the script in the "Scripts" folder. Don't know exactly if that's what you want.

              • 4. Re: How create indesign using Java Script
                Bill joy Community Member

                Thanks Vamitul for reply

                For example when i run SelectObjects.jsx An InDesign CS5.5 JavaScript in ESTK  then message prompt "Target Adove Indesign CS5.5 is not running. Do you want to lanch." Then on click yes Indesign application start.

                I want to Know how indesign object "app" is created to start Indesign application on click yes.

                http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/indesign/cs55-docs/In DesignScripting/InDesign-ScriptingTutorial.pdf

                Like in VB to create indesign object we use CreateObject("InDesign.Application"). In javascript how create object say "app" of InDesign Application.

                For example if  i write

                 

                var myDocument = app.documents.add();

                var myTextFrame = myDocument.pages.item(0).textFrames.add();

                myTextFrame.geometricBounds = ["6p", "6p", "24p", "24p"];

                myTextFrame.contents = "Hello World!";

                 

                in a simple text file and save it with .js extention and to open this double click on this  it give error undefined "app".

                Source :Microsoft JScript runtime error

                 

                So how define "app" or create indesign object ?

                 

                Thanks

                • 5. Re: How create indesign using Java Script
                  Vamitul Community Member

                  i understand, and the answer is still No, you cannot.

                  VB si a windows global scripting language, runed by the os, like applescript. javascript, or more precised jsx is runned by the Adobe application. So, the app needs to be running.

                  you can, i think to make a vb script to initialize the aplicattion and then call (still from VB) a javascript. i think. but since i never used vb, i'm not sure.

                  • 6. Re: How create indesign using Java Script
                    Bill joy Community Member

                    Thanks Vamitul for reply

                     

                    Can  I use Adobe InDesign CS5.5 SDK to create Indesign Application instance.

                    If yes Then plz tell me how use sdk to create indesign application. and which .h file use to create instance.

                     

                    Thanks