Back

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

Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • in reply to: Update Indesign DOM after inserting text #12343160

    Hi Felix,

    Not sure what content1 and content2 are in your case.
    A script like following worked fine for me:

    var textFrame = app.selection[0];

    alert(textFrame.texts[0].length); // 5
    textFrame.texts[0].duplicate(LocationOptions.AT_END, textFrame);
    alert(textFrame.texts[0].length); // 10

    Regards,
    MT

    in reply to: MixedInksGroup Javascripting? #14323260

    Yes, MixedInkGroups and ColorGroups are different things.
    To add a mixed ink (or any swatch for that matter) to a ColorGroup, you can do:

    var mixedInkSwatch = // as created in your code
    app.activeDocument.colorGroups.add(“My Mixed Inks”, [mixedInkSwatch]);

    Regards,
    MT

    in reply to: MixedInksGroup Javascripting? #14323265

    Hello,

    MixedInkGroups.add lets you generate multiple mixed inks (from a combination of inks), as done in UI by Swatches > New Mixed Ink Group.

    inkList – inks to use to create the mixed inks
    inkPercentages – Array of initial percentages for each ink from inkList
    repeatValues – Array of repetitions for each ink
    incrementValues – Array of increments to use when repeating

    For example,
    [Proces Cyan, PANTONE 281 C] with percentages [0, 0], repeatValues [2, 2], ad increments [10, 10] would create (2 + 1) x (2 + 1) = 9 mixed inks.

    Cyan %, PANTONE 281 C %
    (0, 0)
    (0, 10)
    (0, 20)
    (10, 0)
    (10, 10)
    (10, 20)
    (20, 0)
    (20, 10)
    (20, 20)

    Hope this helps.

    Regards,
    MT

    in reply to: How to add a Link (^D) in Indesign using VBScripts #14323336

    Hi,

    You can move the page item after you paste.
    pageItem.move([x, y]);

    Regards,
    MT

    in reply to: Math.sign doesn't exist!!! #14323337

    Yes, Math.sign does not exist in ExtendScript.

    Math.sign and other such functions, for example String.startsWith, Array.indexOf have been added to newer versions of ECMAScript, and are available in web browsers, but not in ExtendScript.

    I tend to use polyfills for such cases.

    From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign

    if (!Math.sign) {
    Math.sign = function(x) {
    // If x is NaN, the result is NaN.
    // If x is -0, the result is -0.
    // If x is +0, the result is +0.
    // If x is negative and not -0, the result is -1.
    // If x is positive and not +0, the result is +1.
    return ((x > 0) – (x < 0)) || +x;
    };
    }

    Add this polyfill, and your code should work fine.

    Thanks,
    MT

    in reply to: Start position of paragraph text #14323443

    Thanks, Brian !

Viewing 6 posts - 1 through 6 (of 6 total)