new line in indesign scripting

Hi all

How can I set the line spacing?

now I need to add some lines in textframe, and I use "vbNewLine" for the new line,

but the spcing between 2 lines too...

is it possible for me to set the line spacing?

Thank you

spacing is controlled - as in the UserInterface - the largest property

or you can set the properties then SpaceBefore and SpaceAfter to set space before and/or after paragraph

Robin

www.adobescripts.co.UK

Tags: InDesign

Similar Questions

  • Other new lines in SQL script file and problem with SQL * more

    Hi all


    I would like to ask a question on the characters of new line inside files SQL scripts. I have a very long SQL query, stored in a file txt (ANSI encoding). Because query instructions are very long (several table joins and WHERE conditions) tried to separate, WHERE and ORDER BY clauses by inserting several new characters of lines (just hit the entrance) among them in order to improve the clarity of the source code. Now the problem is, whenever these newline characters are inserted in the file, apparently SQL * Plus cannot parse the file properly and gives me the following error message:
    SP2-0042: unknown command "FROM" - rest of line ignored.
    SP2-0734: unknown command beginning "myenterpri..." - rest of line ignored.
    The problem is definitely related to these new line because characters that when I remove them, the scripts runs without any problem. I would appreciate that you could kindly guide me how should I deal with this problem. Is there any SQL * Plus command to run to correctly interpret the new line characters?


    Thanks in advance,


    Kind regards
    Dariyoosh

    Hello

    In [SQL * Plus 9 | http://download.oracle.com/docs/cd/B10501_01/server.920/a90842/ch13.htm#1013073] (and), you can tell

    SET     SQLBLANKLINES   ON
    

    allow to completely empty rows in an SQL statement.

  • I'm new in indesign scripting, please tell me how to write a script to get the contents of an XML element and then sort all the content

    I'm new in indesign scripting, please tell me how to write a script to get the contents of an XML element and then sort all the content

    Hello

    Can the code below is useful for you, but I do not know how to sort.

    Change the tag based on your employment application.

  • Add new line of vacuum for ePub Using Adobe InDesign CS5.5

    Hello

    I am new to ePub, I test ePub to see the possubilities and made a lot of success.

    I am facing a problem I don't know how to do.

    I need to creat empty new line betwwn the title and the body of the text, I know that the more difficult is to make an image for the title and other chassis for the body, it will take a lot of time to complete the book.

    I tried to add blank lines with the button Enter on my keyboard, but does not work.

    Thanks in advance

    Less familiar with CSS than Bob does, I managed by defining a paragraph style for the title that has a large amount of the space below.

    While white space (returns, etc.) is ignored when InDesign generates the CSS, styles of paragraph with space before and after are converted into equivalent CSS settings.

  • Edit an Indesign script for me?

    Hi all!

    I'm fairly new to Indesign scripting and I have a script here that I would have changed.

    This script puts a several page pdf in an Indesign file and add pages as needed. From now this script appears in a dialog box that asks you what document I want than the PDF to be placed in, and I would like to have this dialog box eleminated and have the script automatically place the pdf file in the document I have active. This script also asked which page to start to put the pdf file on and I would if it would simply just start automatically on the first page of the Indesign document active without even asking me. Someone would be willing to make these changes for the script below and zip code on this thread? Let me know if I did something clear.

    var myDocument = app.activeDocument;
    //Get the current page.
    main();
    function main(){
      //Display a standard Open File dialog box.
      var myPDFFile = File.openDialog("Choose a PDF File");
      if((myPDFFile != "")&&(myPDFFile != null)){
      var myDocument, myPage;
      if(app.documents.length != 0){
      var myTemp = myChooseDocument();
      myDocument = myTemp[0];
      myNewDocument = myTemp[1];
      }
      else{
      myDocument = app.documents.add();
      myNewDocument = false;
      }
      if(myNewDocument == false){
      myPage = myChoosePage(myDocument);
      }
      else{
      myPage = myDocument.pages.item(0);
      }
      myPlacePDF(myDocument, myPage, myPDFFile);
      }
    }
    function myChooseDocument(){
        var myDocumentNames = new Array;
        myDocumentNames.push("New Document");
        //Get the names of the documents
        for(var myDocumentCounter = 0;myDocumentCounter < app.documents.length; myDocumentCounter++){
            myDocumentNames.push(app.documents.item(myDocumentCounter).name);
        }
        var myChooseDocumentDialog = app.dialogs.add({name:"Choose a Document", canCancel:false});
        with(myChooseDocumentDialog.dialogColumns.add()){
            with(dialogRows.add()){
                with(dialogColumns.add()){
                    staticTexts.add({staticLabel:"Place PDF in:"});
                }
                with(dialogColumns.add()){
                    var myChooseDocumentDropdown = dropdowns.add({stringList:myDocumentNames, selectedIndex:0});
                }
            }
        }
      var myResult = myChooseDocumentDialog.show();
      if(myResult == true){
      if(myChooseDocumentDropdown.selectedIndex == 0){
      myDocument = app.documents.add();
      myNewDocument = true;
      }
      else{
      myDocument = app.documents.item(myChooseDocumentDropdown.selectedIndex-1);
      myNewDocument = false;
      }
      myChooseDocumentDialog.destroy();
      }
      else{
      myDocument = "";
      myNewDocument = "";
      myChooseDocumentDialog.destroy();
      }
        return [myDocument, myNewDocument];
    }
    function myChoosePage(myDocument){
        var myPageNames = new Array;
        //Get the names of the pages in the document
        for(var myCounter = 0; myCounter < myDocument.pages.length;myCounter++){
            myPageNames.push(myDocument.pages.item(myCounter).name);
        }
        var myChoosePageDialog = app.dialogs.add({name:"Choose a Page", canCancel:false});
        with(myChoosePageDialog.dialogColumns.add()){
            with(dialogRows.add()){
                with(dialogColumns.add()){
                    staticTexts.add({staticLabel:"Place PDF on:"});
                }
                with(dialogColumns.add()){
                    var myChoosePageDropdown = dropdowns.add({stringList:myPageNames, selectedIndex:0});
                }
            }
        }
        myChoosePageDialog.show();
        var myPage = myDocument.pages.item(myChoosePageDropdown.selectedIndex);
        myChoosePageDialog.destroy();
        return myPage;
    }
    function myPlacePDF(myDocument, myPage, myPDFFile){
      var myPDFPage;
      app.pdfPlacePreferences.pdfCrop = PDFCrop.cropMedia;
      var myCounter = 1;
      var myBreak = false;
      while(myBreak == false){
      if(myCounter > 1){
      myPage = myDocument.pages.add(LocationOptions.after, myPage);
      }
      app.pdfPlacePreferences.pageNumber = myCounter;
    
         myPDFPage = myPage.place(File(myPDFFile), [0,0])[0];
      if(myCounter == 1){
      var myFirstPage = myPDFPage.pdfAttributes.pageNumber;
      }
      else{
      if(myPDFPage.pdfAttributes.pageNumber == myFirstPage){
      myPage.remove();
      myBreak = true;
      }
      }
      myCounter = myCounter + 1;
      }
    }
    var myPDFFrame =  myPlacePDF.parent;
    

    Thank you very much in advance for your help! I greatly appreciate it!

    This is a rewrite for you. I also added some code to remove empty pages in the document.

    /*

    PlaceMulitpagePDF condensed by Skemicle Script

    */

    If (parseFloat (app.version)<>

    main();

    on the other

    app.doScript (principal, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Place Multipage PDF");

    main() {} function

    var myPDFFile is File.openDialog ("choose a PDF file");.

    If ((myPDFFile! = "") & (myPDFFile!) (= null)) {}

    var = app.activeDocument myDocument,

    myPage = myDocument.pages.item (0);

    var myPDFPage;

    app.pdfPlacePreferences.pdfCrop = PDFCrop.cropMedia;

    var myCounter = 1;

    var myBreak = false;

    while(myBreak == false) {}

    If (myCounter > 1) {}

    my page = myDocument.pages.add (LocationOptions.after, myPage);

    }

    app.pdfPlacePreferences.pageNumber = myCounter;

    myPDFPage = myPage.place (File (myPDFFile), [0,0]) [0];

    if(MyCounter == 1) {}

    New var features = myPDFPage.pdfAttributes.pageNumber;

    } else {}

    if(myPDFPage.pdfAttributes.PageNumber == myFirstPage) {}

    myPage.remove ();

    myBreak = true;

    }

    } myCounter = myCounter + 1;

    }

    } var pages = app.activeDocument.pages;

    for (c = 0; c<>

    If (pages.pageItems.length [c] == 0) {}

    pages [c]. Remove();

    }

    }

    }

  • InDesign Scripting - increase of height of 1 mm

    Hello

    I'm still new to indesign scripting and have struggled to find an answer.

    I have an empty rectangle frames page, all different sizes.

    Is there a way I could select all images, run a script 'enlarge' via a keyboard shortcut, and all the boxes will increase by 2mm X + Y in the center of the frame.

    Example - Frame w: 63mm frame h: 87.3 mm

    < run Script - width = width + 2mm, height is height + 2mm >

    < result >

    Frame w: 65mm h frame: 89.3 mm (from the Center)

    < image >

    Repeat the <>

    I'd appreciate any help I can get on this issue

    Thank you!

    Indiscripts: Equalizer 3 BETA new features

  • "No Image file in the line of subtitle script" - Adobe Encore CS6

    I'm a beginning of work with Adobe Encore CS6. I'm looking for a resolution how to import a .fab file in Adobe Encore. When I import the file .fab and choose the location of the folder of the image file, a pop-up window shows "No Image file in the line of subtitle script" despite the fact that there are image files in the folder. What should I do? Any suggestion would be great!

    I think that the spaces in the file names of your image is shaking again. He sees the first space, reads the name of your picture as "Océans", and cannot find any file named Oceans. You can try to edit the script file to put the image file name in quotes, but I don't know if it will work.

    You can also rename the actual image names to remove the spaces (and I would like to delete the hyphens and use points out), so: Oceans2a_English_test0007.png and then edit the script file for new names.

    A colon in your time code, I think that mark in nondrop.

  • Add a new line of text/function in a file html with JSFL

    , I want to add a line of text/function in an existing html file. I can read the file with FLfile.read() , and this is my code:


    var pathCom=fl.getDocumentDOM().pathURI(); //get complete path

    var pathWOFile=pathCom.substr(0,pathCom.lastIndexOf('/')); //get the path without file

    var readFile=FLfile.read(pathWOFile+'/index.html'); //read the html file

    alert
    (readFile);


    and the structure of my html file is:


    <html>
     
    <head>

      
    <script>
      
    //i want to add a new function on this line
      
    </script>

     
    </head>
     
    <body>
     
    </body>
    </html>


    I already know there is a function called FLfile.write() to add some text to the file, but the text still added to the last line of the structure. Now, I want to add a function of text to the line between the <script> tag, how I did that, sorry for my bad English and thanks for your reply

    If it is always static (that is, you know exactly the tag) you can treat it as alternative text. I suggest you add an id to the tag so there is no confusion as

    var writeFileContent = readFile.replace("", "")
    

    And then rewrite the entire file

  • How to change type of police using InDesign scripting (Javascript)?

    Hello

    I need to change the font type of a document, InDesign using InDesign script (javascript). I found a few online references in the InDesign scripting guide and running extract next, gives me errors.

    Delete existing preferences

    app.changeTextPreferences = NothingEnum.nothing;

    app.findTextPreferences = NothingEnum.nothing;

    app.findChangeTextOptions.caseSensitive = false;

    app.changeTextPreferences.appliedFont = app.fonts.item ("DEVANAGARI MT");

    App.Documents.Item (0) .changeText ();

    Download the msg of InDesign server.

    Error code: 1

    Error description: changeText

    The indesign file that is used to change the font is certainly not corrupt, cause the following script to export the file in .png works very well. Any help appreciated.

    app.pngExportPreferences.exportResolution = 100.0;

    App.Documents.Item (0) .exportFile (ExportFormat.PNG_FORMAT, PreviewDocument don't);

    Hello

    Try this 1-liner:

    app.documents.item(0).stories.everyItem().appliedFont = app.fonts.item("DEVANAGARI MT");
    

    Guess above specified police is available. Some disorders may begin with the name of the font, cause not always WYSIWYG.

    To be sure how to refer to a specific font by its name - a console text and notice of runing ESTK select this option:

    app.selection[0].appliedFont.name
    

    Jarek

  • Forcing of the styles of character on a new line?

    Hello. I have a request for information about to break a character on a new line style automatically. I can do this using F + R or a script, but I hope I can achieve through nested styles or a GREP style?

    In my example, the text in blue is the main "PoemText" paragraph style, while green is words imported from an XML document. The PoemPart1 character style (there are about 12 in the document, one for each page) simply changes the color of the word at the moment, but in this case I would like the word Maya to appear on a new line. Thank you!

    Example.jpg

    Use the GREP tab...

  • New line ' n does not

    I am writing a small file in a newspaper, and he held the names of several virtual machines.  I want to make sure that I put the date with the names of virtual machine, and then I want a new line for each virtual computer.  I tried something like this:

    ("$(Get-date-format JJ-MM-AA) 'r' n' + '$Removed'). Out-file c:\Scripts\test.txt-Append

    The date shows and at first, I was only using 'n to the new row, and then I tried' r and n, but everything gets put on one line and then spaced, like this:

    12/09/13 VMname VMname

    I'm sure I'm missing something simple, but why isn't the new line appearing?

    Try changing this line in

    ("$(Get-date -format MM-dd-yy)") + "`r`n" + ($Removed | out-string) | Out-File C:\deleted.txt -Append
    
  • How to add a new line in the JavaScript editor?

    I have a script like this:

    var n = this.getField("score").value;

    If (n > = 0 & & n < 5) {}

    Event.Value = "The WP 100% Bond\nThe 10% Stock WP / 90% Bond\nThe WP 20% Stock / 80% Bond."

    }

    I want out of this line as...

    The leap from 100% WP

    The Stock of 10% WP or the Bond of 90%

    The Stock of 20% of WP or 80%

    But it's not to honor the \n for a newline. How in the heck can you add a new line? I tried \r, \r\n, \n\n. It is to add a space character and looks like this...

    The leap from 100% WP WP 10% Stock or the Bond of 90% 20% of WP Stock or Bond of 80%

    You can use \n like you did to indicate a new row or \r (carriage return). If this does not work, be sure to set the Multiline field on the Options tab of the field properties dialog box.

  • InDesign script to run on the action?

    Hi, can someone help - is it possible to set up an indesign script to be triggered to perform an action, for example when you export to PDF (instead of manually running the script)? To explain, I have a script that creates a text box to display the size of the indesign document, but if the size of the page change the text box does not update unless you manually run the script again. so I was wondering if it was possible to put the script to run when the document is exported to PDF, so in theory be PDFd with the size of the pages always display up-to-date!

    I approach this issue perspective, as altogether new to the am scripts.

    Thanks in advance for any suggestions.

    Hi Trevor - thank you very much for this - (after a bit of trial and error with changes!) managed to make it work.

    Work of great stuff.

    Thanks again

  • Canvas support in Indesign scripts?

    Hello

    short version:

    I was wondering if it is possible in any way to include automatically generated content (Using canvas api for example) raster design using JavaScript?

    Long version:

    I noticed that the In-design supports a very old version of JavaScript, and since I'm pretty new to InDesign scripting, I thought, it's best to inquire about its capabilities / limitations before planing on what to do with it! I wrote a Javascript (not in in-design script) code which generates unique random patterns of patterns, now, I'm interested if I can integrate it into scripts in design so she would put one of these raster images in each page of a design document (IE: left and right of each face relatively pages);

    also since my first guess after reviewing documentation of object a little design model has been that it is very limited to what is possible via the user interface software (and not everything/something new/more), so I was wondering (in this case), how is it possible to connect a script for an external script and send and receive the data/vars between them; like putting the two scripts in the same folder, one calls the other is giving some info (size of the document, etc.), the second script runs (outside of ID), put the images on the disk and return to the main script when's done it! :/

    I have a few other sketches of solution as well in my mind, but wanted to get your opinion before doing anything ridiculous! :-)))

    I really appreciate your in - put on this point.

    THX, mim,

    And Yes! It seems that I can run an external file of any type!

    After reading and looking for some time, finally:

    In the page 52nd documentation, it says:

    Execute()
    fileObj.execute)
    Open this file using the appropriate application, as if she had been double-clicked in a file Explorer. You can use this method to run scripts, launch applications and so on

    Voila! Exactly what I need (if what I think I need is actually what I need! indeed!)

    I'll try to see if it works later (actually impatient!) and thx again!

    mim

  • Format text in bold in the field and to put text on a new line - help!

    I'm lost.  I found the rich text formatting item click.  But after that, I don't know what to do next.  I want "BOLD" of some characters and I want some answers on separate lines, as I asked earlier.  As for spans and controls - I have no programming experience.  I just used that George gave to me.  It worked fine, but I just need that bold text in one part of the text to print field and I need some items to be on separate lines.  But I don't know where to put the information you say on the spans and I do not know the use of bold text or script start text on a new line.  I'm into the calculation of the area of text box?  Sorry to be so lame, but I'm no good in programming skills.  Help!

    For example, here's the script.  In aISOreq {[0], if I want to "BOLD" "Check #1 patter: ', where should I put the span and what script should I use to say to"BOLD"it.}   Could you give me an example, please.  Also, if I want to put 'a. drugs weekend on one line?' and ' b. activities the weekend? Types of activities? Supervision? With whom? "on the next line, where do I put the span and what script should I use to put on separate lines?  Could you give me an example for this too, please.  I have used literally just scripts George gave me and they work great - but it's all I know how to do.  Thank you.

    (function () {}

    Set up a table to hold the various paragraphs of the text

    var aISOfreq = [];

    Fill the table with text of paragraph

    aISOfreq [0] = ' model #1: reducing several isolations on Mon & Tue to Fri. "  Model # 1 verification: a. drug weekend?  b. activities weekend? Types of activities? Supervision? With whom? « ;

    aISOfreq [1] = ' model #2: isolation of multiple some days. "  Note the days.  The #2 model checking: a. Different plan these days there? Another adult? Block-schedule? Need to w/same adult consistent schedule.  b. adaptations/changes occur? More group c. individual training? Does the student need warm-up exercises or a specific job?  Student needs a specific lesson routine? c. activities of the previous night?  Need of calming activities before bedtime?  Need to bed earlier? Need additional evening structure? « ;

    aISOfreq [2] = ' model #3: Isolations are grouped intermittently. "  Interval of note.  The #3 model checking: a. cyclical behaviour?  Review the assessment.  Need reference mental health intervention of medication or treatment?  b. drugs: supervision? Self medication? Taking constantly? Need medication collate doctor?  Share concerns with the doctor?  c. history of the abuse of legal or illegal drugs?  Cyclic model to share with the doctor.  On probation?  Share concerns with PO? « ;

    aISOfreq [3] = "models #1 & #2: multiple Isolations on Mondays & Tuesdays to Friday AND several Isolations some days."  Note the days.  Model #1 verification: a. drug weekend?  b. activities weekend? Types of activities? Supervision? With whom?  The #2 model checking: a. Different schedule some days? Another adult? Block-schedule? Have a consistent schedule with same adult.  b. adaptations/changes that occur? More group c. individual training? Need of specific work or warm-up exercises?  Need a specific lesson routine?  c. activities of the previous night? Need of calming activities before bedtime? Need to bed earlier? Additional needs night structure? ";

    aISOfreq [4] = "models #1 & #3: multiple Isolations on Mondays & Tuesdays decreasing Friday AND insulation together intermittently."  Note intervals.  Model #1 verification: a. drug weekend?  b. activities weekend? Types of activities?  Supervision? With whom?   The #3 model checking: a. cyclical behaviour?  Review the assessment.  Need reference mental health intervention of medication or treatment?  b. supervision of drugs? Self medication? Taking constantly? Must check with the doctor med?  Share concerns with the doctor?  c. history of the abuse of legal or illegal drugs?  Cyclic model to share with the doctor.  On probation?  Part of the concerns of w/PO? »

    aISOfreq [5] = ' patterns #2 and #3: several isolates on a day specific AND insulation together intermittently. "  Note day & intervals.  The #2 model checking: a. different planning? Another adult? Block-schedule? Need to w/same adult consistent schedule.  b. adaptations/changes that occur? More group c. individual training? Need exercises to warm-up or a specific job?  Need a specific lesson routine? c. activities of the previous night?  Need of calming activities before bedtime?  Need to bed earlier? Additional needs night structure?  The #3 model checking: a. cyclical behaviour? Review the assessment.  Need reference mental health intervention of medication or treatment?  b. supervision of drugs? Self medication? Taking constantly? Need medication collate doctor?  Share concerns with the doctor?  c. history of the abuse of legal or illegal drugs?  Cyclic model to share with the doctor.  On probation?  Share concern w/PO? « ;

    aISOfreq [6] = ' bosses, #1, #2 and #3: several isolations on Mondays & Tuesdays decreasing through Friday, several isolates some days AND insulation together intermittently. "  Note the days and intervals.  Model #1 verification: a. drug weekend?  b. activities weekend? Types of activities? Supervision? With whom?   The #2 model checking: a. different planning? Adult?  Block-schedule?  Need to w/same adult consistent schedule.  b. adaptations/changes that occur? More group c. individual training? Need exercises to warm-up or a specific job?  Need a specific lesson routine? c. activities of the previous night?  Need of calming activities before bedtime?  Need to bed earlier? Additional needs night structure?  The #3 model checking: a. cyclical behaviour? Review the assessment.  Need reference mental health intervention of medication or treatment?  b. supervision of drugs? Self medication? Taking constantly? Need medication collate doctor?  Share concerns with the doctor?  h. history of the abuse of legal or illegal drugs?  Cyclic model to share with the doctor.  On probation?  Share concern w/PO? « ;

    aISOfreq [7] = "without cause."

    Get the selected item, which is the value of exports of the selected drop-down list box item

    var point = getField("ISO_Frequency_Pattern").value;

    Display the text corresponding to the selected item in the text field

    Event.Value is aISOfreq [point];.

    })();

    Look at the richValue of the Field object property reference. It contains a few examples of how it should be done. Read also the Span object reference.

Maybe you are looking for