Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Scripting in vb.net

Guest
Jul 27, 2010 Jul 27, 2010

I need to know how to create indesign document with layers and layers conataining textframes. How to do this with vb.net or javascript.

Pls help!!!!!!!!!!!!!!!!!!

TOPICS
Scripting
722
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jul 27, 2010 Jul 27, 2010
LATEST

You can see below code for javascript example.

//MakeTextFrameAndLayer.jsx
//An InDesign CS4 JavaScript
//
//Creates a text frame in an example document.
main();
function main(){
    mySetup();
    mySnippet();
    myTeardown();
}
function mySetup(){
    var myDocument = app.documents.add();
    //Set the measurement units to points.
    myDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
    myDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
}
function mySnippet(){
    //<fragment>
    var myDocument = app.documents.item(0);
    var myPage = myDocument.pages.item(0);
     //Add a layer.
     try{
          var myLayer = myDocument.layers.item("myLayer");
          myLayer.name;
     }
     catch (myEror){
          var myLayer = myDocument.layers.add({name:"myLayer"});
     }
     var myTextFrame = myPage.textFrames.add();
    //Set the bounds of the text frame.
    myTextFrame.geometricBounds = [72, 72, 288, 288];
    //Enter text in the text frame.
    myTextFrame.contents = "This is some example text."
    //Note that you could also use a properties record to
    //create the frame and set its bounds and contents in one line:
    //var myTextFrame = myDocument.pages.item(0).textFrames.add({geometricBounds:[72, 72, 288, 288], contents:"This is some example text."});
    //</fragment>
}
function myTeardown(){
}

Shonky

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines