Back

If your email is not recognized and you believe it should be, please contact us.

Forum Replies Created

Viewing 15 posts - 481 through 495 (of 584 total)
  • Author
    Posts
  • in reply to: Grep to break single work paragraph #94908

    Hi,

    Here, we talk about the last word of each line of the para following a sentence end as “. “, “? ” “! ” …

    The grep code I gave means that a grep style applies a “no-break” to “this” word [\w-]+ and its space that follows!

    … So, it’s totally impossible to have at the end of a line in a para a single word after, e.g. a dot: It will magically jump to the beginning of the next line!

    Of course, all the words in that situation (after a dot) are targeting by the grep style but no importance (e.g. in the middle of a line).

    (^/)

    in reply to: Rounded corners #94886

    Just a misunderstanding! ;-)

    View post on imgur.com

    (^/)

    in reply to: Update Multiple/All Table of Contents at once? #94883

    If you wanna update “all” the TOCs, use this:


    for (var i = 0; i < nTocStyles; i++) {

    (^/)

    in reply to: Update Multiple/All Table of Contents at once? #94876

    Kai,

    Totally right!

    Personally, as you know, only one-line script for free!

    (^/) ;-)

    in reply to: Grep to break single work paragraph #94862

    Masood,

    Maybe you do ignore some things about Grep! Try before commenting! ;-)

    I don’t beleive in God! … Only The Force!

    (^/)

    in reply to: Grep to break single work paragraph #94856

    Grep style:

    Grep code: [.?!;:…]\K[\w-]+ [to be eventually completed!]
    Char style: no-break [to be included!]

    (^/)

    One exception! — For Free! ;-)

    Just modify the script depending of the book contents [color values/files number, each color values spec.]

    The global color name is: “ChapterColor”.

    Open the “book”, sync. it and finally launch this script:

    var myBook = app.activeBook,
    myBookContents = myBook.bookContents,
    D = myBookContents.length,
    //————————————————————————-
    myColorValues = [
    //—– DEFINE EACH CHAPTER COLOR [C,M,Y,B]
    //—– For memory, between *: the doc name (“Blue”, “Magenta” …]
    //—– In the book right order:
    /*Blue*/ [50,0,0,0], // The 1rst file of the book
    /*Magenta*/ [0,50,0,0], // The 2nd file of the book
    /*Yellow*/ [0,0,80,0], // The 3rd file of the book
    /*Green*/ [80,0,80,0], // The 4th file of the book
    // …………………………………………………………………………………………………………
    /*Red*/ [0,80,80,0]]; // The last file of the book
    //————————————————————————-

    for (var d = 0; d < D; d++) {
    var myFile = myBookContents[d].fullName.toString(),
    myDoc = app.open(File(myFile)),
    myColor = myDoc.colors.itemByName(“ChapterColor”);
    myColor.colorValue = myColorValues[d];
    myDoc.close(SaveOptions.YES);
    }

    The script just modifies the values of the “ChapterColor” color in each doc and after having done it, saves and closes the file and continues with the next one!

    (^/)

    in reply to: force line break after 50 caracters #94770

    Yeap! It will take time! 1 second! =D

    Find: .{49}\K.
    Replace by: $0

    … if you consider a space as a char!

    If not, you’ll need more regex (3 if you consider all spaces as same ones) and more time! Maybe 2 op-seconds! =D

    Find:
    Replace ~j

    Find: .{49}\K.
    Replace by: $0

    Find: ~j
    Replace by:
    (type a normal space)

    (^/)

    in reply to: force line break after 50 caracters #94751

    ??

    On ne va pas avancer vite à ce train-là !! =D

    in reply to: force line break after 50 caracters #94749

    ??

    Je pensais plutôt à : Pourquoi couper les lignes après le 50e caractère ! =D

    (^/)

    in reply to: force line break after 50 caracters #94747

    C’est quoi la finalité ?

    (^/)

    in reply to: force line break after 50 caracters #94745

    To find the 51th char:

    (?-s)^.{50}\K.

    To find text after 51th char until the end of the para:

    (?-s)^.{50}\K.+

    (^/)

    in reply to: Need script to run multiple scripts using InDesign … #94700

    Hi David, truly complex!

    Think Simple: Grep styles!

    A sample:

    https://forums.adobe.com/thread/2265937

    (^/)

    Hi Kai,

    1/ It’s your personal interpretation of what is “a line”! No worry for me! ;-)
    2/ My code is totally readable! [about this point, I suggest you to take a look to the Great Master Marc Autret’s artwork!]. Especially, not sure adding or not parentheses everywhere would be more preferable! About this, Peter Kahrel wrote: “… many people […] write single lines in brackets […] but this is not needed …” relevant too about line returns!
    3/ I’m more interested by a technical discussion about your mention “… if you work with pageItems.everyItem(), you will not get every items! …”: your script won’t find: items on master pages or locked/not visible layers, locked items [and maybe other cases!], not mine!

    (^/)

    PS: Beyond writing its code, concentrate here such a script on 1 line was a joke! … but maybe you have less humour than me! ;-)

Viewing 15 posts - 481 through 495 (of 584 total)