Forum Replies Created
-
AuthorPosts
-
Mahesh Thambe
MemberHi 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); // 10Regards,
MTMahesh Thambe
MemberYes, 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,
MTMahesh Thambe
MemberHello,
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 repeatingFor 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,
MTJanuary 4, 2020 at 11:43 pm in reply to: How to add a Link (^D) in Indesign using VBScripts #14323336Mahesh Thambe
MemberHi,
You can move the page item after you paste.
pageItem.move([x, y]);Regards,
MTMahesh Thambe
MemberYes, 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,
MTMahesh Thambe
MemberThanks, Brian !
-
AuthorPosts
