How to add multiple tabStops at the same time...

Hello

I know it's a bit basic, but I fight

I am trying to create four tabStops in a paragraph style. That's what I have so far... but when it comes to tabStops [1], he died... I think that something is wrong with how I create the four tabStops, but I do not know what... Do you think what I am doing wrong?

Thank you!
Christopher

try {}

myParagraphStyle = myDocument.paragraphStyles.item ("Verse");

myName = myParagraphStyle.name;

}

{} catch (e)

myParagraphStyle = myDocument.paragraphStyles.add({name:"Verse"});)

myParagraphStyle.tabStops.add ();

myParagraphStyle.tabStops.add ();

myParagraphStyle.tabStops.add ();

myParagraphStyle.tabStops.add ();

with (myParagraphStyle) {}

appliedFont = "Lexicon No1 A tab";

fontStyle = "Normal";

pointSize = 8.75;

head = 10;

alignToBaseline = true;

Justification = Justification.LEFT_JUSTIFIED;

keepFirstLines = 2;

tabStops [0] .alignment = TabStopAlignment.CENTER_ALIGN;

.leader tabStops = [0] ";

tabStops .position [0] = 5;

crashes here

tabStops [1] .alignment = TabStopAlignment.CENTER_ALIGN;

.leader tabStops [1] = ";

tabStops [1] .position = 10;

tabStops [2] .alignment = TabStopAlignment.CENTER_ALIGN;

.leader tabStops [2] = ";

tabStops [2] .position = 15;

tabStops [3] .alignment = TabStopAlignment.CENTER_ALIGN;

.leader tabStops [3] = ";

tabStops [3] .position = 20;

}

}

It is possible using tabList. Here is a code that did this and sets all the properties at the same time. "with" does NOT define the properties at the same time and should always be avoided.

var myParagraphStyle = app.documents[0].paragraphStyles.item("Verse");
myParagraphStyle.properties = {
  tabList:[
    {
      position: 5,
      alignment: TabStopAlignment.CENTER_ALIGN,
      leader: ""
    },
    {
      position: 10,
      alignment: TabStopAlignment.CENTER_ALIGN,
      leader: ""
    },
    {
      position: 15,
      alignment: TabStopAlignment.CENTER_ALIGN,
      leader: ""
    }
  ],
  appliedFont: "Lexicon No1 A Tab",
  fontStyle: "Normal",
  pointSize: 8.75,
  leading: 10,
  alignToBaseline: true,
  justification: Justification.LEFT_JUSTIFIED,
  keepFirstLines: 2
};

Tags: InDesign

Similar Questions

  • How to select multiple cells at the same time?

    Hello

    How to select multiple cells at the same time? What is the keyboard shortcut?

    Thank you to.

    Flo, a french guy.

    Hold down the CMD key when you select the cells.

  • How read datalog multiple files at the same time?

    Hello friends...

    can someone help me to show how read datalog multiple files at the same time?

    Here is the example of my case.

    I have 500 files in a folder. each file contains a waveform and its setting.

    and then I want to do a card spectral these files, because these files have been saved in the order.

    the point is to know how to read these 500 files at once? I made a program to read these files, but the program can read these files in one by one. So it is very uncomfortable to read 500 files one by one. can someone help me solve this problem? Thank you. I hope you can show me the program. Thank you again...

    Hi jojo,

    Well, in the range of functions daughter, you will find a function to list the contents of the folder. This allows to get the names of all the files datalog, and then use a loop FOR to read.

    No one is obliged to provide 500 names of files manually - that's why we use a programming language to let the computer do the stupid work

  • How to display multiple images at the same time in CS6?

    How to display multiple images at the same time in CS6?

    Hello

    If you go to window > reorganize you can choose from several display options. Below, I have chosen two horizontal spaces since I have two images, but you can select other options if you have more than one image.

  • How to support multiple users at the same time?

    Hi all

    I have a Labview program that controls a parser via GPIB connector. When the user uses the software, user B must wait is made. But in fact, the parser is not very busy, when the user uses the software.

    I want A, B, C and D of the user may use the software at the same time. just as we can open several Web sites at the same time.

    How can I program the software, so that software can be opened several times? Do you have any examples?

    Thank you very much.

    Steven

    Parallel SALVATION,

    you want to use the same material in different forums at the same time? What happens if the user uses a different device as user B setting?

    There could be problems to access the port of connection (GPIB card) at the same time too...

    It's the same usual problem, you'll have to any shared resource. Instead of calling the same software several times at the same time you should make your software up-to-date with multiple users...

  • How to open multiple photos at the same time?

    How can I keep several photos opened at the same time as the default? I have to keep opening
    "get in the window".

    You should be able to create a new workspace with your windows arranged the way you like them.

  • How can I add multiple tabs at the same time?

    In Firefox 3, there is a submenu "bookmark all tabs" under the main "bookmarks" menu This disappeared in Firefox 4. Is it possible to restore this functionality?
    Thank you

    Right-click on a tab, choose "to bookmark all tabs.

  • How to add 2 Manager at the same time

    Hi all I would like to add to the vertical on the screen

    as

    1 VerticalManager to its vertical sides manager 2 as it comes in the form of 2 columns please help me how can I do...

    who is adding to the verical 1 verticalmanager 2 adjecent Manager

    Please help I'm trying to add VerticalManger2 but his view under the VerticalManager1 (that ONE AFTER THE OTHER MANAGERS ARE GETTING ADDED, BUT I DNT WANT AS what I WANT AS MANAGER TO BE ADJECENT to EACT OTHER)

    Concerning

    Adkins

    put these vertical frames in a horizontal Manager

  • How to rename multiple tables at the same time?

    Hello
    I would like to know how to rename several oracle both tables? for example, I test, test_1 test_3 ETC... THE TABLES and I would like to rename them with KC_test, KC_test_1, KC_test_3, etc...

    How to make them at once rather than one by one...

    Thank you.

    Use replace ('KC_table_name', 'KC_');

  • How to add two controls on the same form datagrid? I get the error message...

    Hello

    I have to add two controls on the same page datagrid. When I try to drag an another DataGrid in the components window, it says "an element with that name already exists in the library."

    How can I add multiple controls on the same page datagrid?

    Kind regards.

    _data2 = new XML (event.target.data2);

    should be

    _data2 = new XML (event.target.data);

    (actually, it's better if it was

    _data2 = XML (event.target.data);

  • How to add multiple lines when the button is clicked

    How to add multiple lines when the click on button now is just add a row .plz give me idea how... waiting for answer

    / public final class screen extends MyScreen
    {
    /**
    * Creates a new object of MyScreen
    */
    ObjectChoiceField obj1 obj2, obj3, obj4.
    Table of String() = {'101 ', ' 102'};
    String of shadow [] = {"Shade1", "Shade2"};
    Rolls of string [] = {'101 ', ' 102'};
    String cutting [] = {"100-150", "150-200"};
    Chain of selectedindex1, selectedindex2, selectedindex3, selectedindex4;
    LabelField lbl1 lbl2, lbl3, lbl4;
        
    GFM LinedGridFieldManager;
    HFM HorizontalFieldManager, hfm1, hfm2 hfm3;
    VerticalFieldManager vfmMain;
        
    public MyScreen()
    {
        
    Set the displayed title of the screen
    hfm1 = new HorizontalFieldManager (HorizontalFieldManager.NO_VERTICAL_SCROLL |) HorizontalFieldManager.NO_VERTICAL_SCROLLBAR);
    hfm2 = new HorizontalFieldManager (HorizontalFieldManager.NO_VERTICAL_SCROLL |) HorizontalFieldManager.NO_VERTICAL_SCROLLBAR);
    hfm3 = new HorizontalFieldManager (HorizontalFieldManager.NO_VERTICAL_SCROLL |) HorizontalFieldManager.NO_VERTICAL_SCROLLBAR);
    HFM = new HorizontalFieldManager (HorizontalFieldManager.FIELD_RIGHT);
    vfmMain = new VerticalFieldManager (Manager.NO_VERTICAL_SCROLL |) Manager.NO_HORIZONTAL_SCROLLBAR);
            
    obj1 = new ObjectChoiceField ("", graph, 0, FIELD_LEFT);
    obj2 = new ObjectChoiceField ("", blind, 0, FIELD_LEFT);
    Obj3 = new ObjectChoiceField ("", rolls, 0, FIELD_LEFT);
    Obj4 = new ObjectChoiceField ("", cuts, 0, FIELD_LEFT);
            
    LBL1 = new LabelField("");
    LBL2 = new LabelField("");
    lbl3 = new LabelField("");
    lbl4 = new LabelField("");
            
    ButtonField btnAdd = new ButtonField ("ADD", FIELD_RIGHT);
            
    GFM = new LinedGridFieldManager (4, LinedGridFieldManager.VERTICAL_SCROLL);
            
    hfm1.setMargin (20, 0, 10, 0);
    hfm1. Add (new LabelField ("Chart"));
    hfm1. Add (obj1);
    hfm1. Add (new LabelField ("Shade"));
    hfm1. Add (obj2);
            
    hfm2. Add (new LabelField ("Rolls"));
    hfm2. Add (Obj3);
    hfm2. Add (new LabelField ("Cuts"));
    hfm2. Add (Obj4);
    HFM. Add (btnAdd);
            
    GFM. Add (new LabelField ("Chart"));
    GFM. Add (new LabelField ("Shade"));
    GFM. Add (new LabelField ("Rolls"));
    GFM. Add (new LabelField ("Cuts"));
            
    vfmMain.add (hfm1);
    vfmMain.add (hfm2);
    vfmMain.add (hfm3);
    vfmMain.add (hfm);
    vfmMain.add (new SeparatorField());
    vfmMain.add (gfm);
    Add (vfmMain);
            
    btnAdd.setChangeListener (new FieldChangeListener()
    {
    ' Public Sub fieldChanged (field field, int context) {}
    TODO self-generating method stub
    selectedindex1 = chart [obj1.getSelectedIndex ()];
    selectedindex2 = shade [obj2.getSelectedIndex ()];
    selectedindex3 = rolls [obj3.getSelectedIndex ()];
    selectedindex4 = cuts [obj4.getSelectedIndex ()];
                    
    While (LBL1. GetText(). Equals("") | LBL2. GetText(). Equals("") | lbl3. GetText(). Equals("") | lbl4. GetText(). Equals(""))
    {
    LBL1. SetText (selectedindex1);
    LBL2. SetText (selectedindex2);
    lbl3. SetText (selectedindex3);
    lbl4. SetText (selectedindex4);
                    
    GFM. Add (LBL1);
    GFM. Add (LBL2);
    GFM. Add (lbl3);
    GFM. Add (lbl4);
                    
    }
    }
    });
    }
    }

    Hi Piya,

    I run your code, and according to your logic that it works correctly.

    It's adding that line only once because according to your logic that one line can be added to MDT, if you do not want to add line on each click on the button, follow these steps:

    selectedindex1 = chart [obj1.getSelectedIndex ()];
    selectedindex2 = shade [obj2.getSelectedIndex ()];
    selectedindex3 = rolls [obj3.getSelectedIndex ()];
    selectedindex4 = cuts [obj4.getSelectedIndex ()];

    Lbl1 LabelField = new LabelField("");
    Lbl2 LabelField = new LabelField("");
    LabelField lbl3 = new LabelField("");
    LabelField lbl4 = new LabelField("");
    If (LBL1. GetText(). Equals("") | LBL2. GetText(). Equals("") | lbl3. GetText(). Equals("") | lbl4. GetText(). Equals(""))
    {
    LBL1. SetText (selectedindex1);
    LBL2. SetText (selectedindex2);
    lbl3. SetText (selectedindex3);
    lbl4. SetText (selectedindex4);
                    
    GFM. Add (LBL1);
    GFM. Add (LBL2);
    GFM. Add (lbl3);
    GFM. Add (lbl4);
                    
    }

  • I can't have multiple files open at the same time! I need to compare the content from one to the other. How to display two files at the same time?

    I can't have multiple files open at the same time! I need to compare the content from one to the other. How to display two files at the same time?

    Hi sindres79946597,

    Open Acrobat Reader DC, navigate to the Edit-> Preferences-> General-> uncheck "Open Documents in the new tab in the same window.

    Now, reboot your system, when you open multiple PDFs that all will open in a new window so that you can easily compare.

    Kind regards
    Nicos

  • Can I download multiple files at the same time? How?

    Can I download multiple files at the same time? How?

    Hi sday706,

    If you're referring to Acrobat.com, you can certainly.

    1. Sign in to your account on https://cloud.acrobat.com/files with your Adobe ID and password.
    2. Click the icon of the file download (the cloud and arrow icon) at the top right.
    3. Select the files you want to download. Shift-click to select contiguous files. Or Ctrl + click (Windows) or command-click (Mac OS) to click on non-contiguous files.
    4. Click on choose.

    Please let us know how it goes.

    Best,

    Sara

  • How can I request a preset to multiple pictures at the same time?

    I'm almost embarrassed to ask this, because it seems so simple. But I am new to LR and need help.

    I want to apply a preset (exmample, a preset that resembles the film) to multiple pictures at the same time. (similar to edit in Photoshop batch) but I want to want the balance of whites etc is necessarily the same thing, of course. Help, please!

    Make that 99jon wrote, then select all the thumbnails of the images you want to apply a preset. (ctrl + click is sometimes a bit boring to select different in the grid images when browsing a large number of them. consider using the spray can and apply a label of color to the images you want brand. and then filter for color you "pulverized").

    After selection there is no need to switch to the module development for appl a saved preset. In the library module go to quickly develop Panel and select the preset from the "Preset" drop saved.

    Make sure that the preset affect only the properties you want to change. If the white balance must remain intact, then check the box for the white power off balance when you save a preset.

    Oli

  • How to share several files at the same time?

    iI am trying to share a number of edited files and sending one at a time takes too much time. How to share several files at the same time?

    Yes, you can select and send/share several files at once.

    Start https://cloud.acrobat.com/send. Click Select files to send and then follow the instructions in file selection. If you want to add more files, simply click on add files:

    You can include up to 50 files by "transaction".

Maybe you are looking for

  • Internet problem

    When I use Internet, I click on the Firefox icon (fox that surrounds the world), and he would go to Google. I would always see what Google would show for that day or week. But in recent weeks, I had an image f two women get is a video. I tried to add

  • How can I import all my favorites (including records to the breast) Internet explore?

    In internet explore, my favorites are organized into folders but when I try to import in firefox only 1 which are not in the files crossed in this case.

  • Error memory suppy

    My M1212Mf started to display "Error memory production" 9 months in. The HP site suggested he looking for foreign bodies and otherwise, to return. I returned it, and a new fact as well. What is the problem? Nothing filed in each machine. It is connec

  • Windows 8 struck looping self-repair

    My inspiron 660 is struck in a self-healing loop Last night, I was watching a dvd, my pc freeze and since I can not restart. He's trying to fix then to restore then nothing happens

  • full installation of Windows vista files

    Respected Sir/Madam, I have problem in bought and installed windows vista operating system, so I need an extra copy of already purchased the operating system windows vista, for the complete installation file containing the package.