m1b
Community Expert
m1b
Community Expert
Activity
an hour ago
I'm a bit confused by the Japanese in the script list. The Katagana characters: "ホワイト" are a sort of phonetic version of the English word White. Hiragana would be used to phonetically sound out Japanese words. The actual Japanese word for White is Shiro. Google's translate app shows a Kanji glyph: 白 (or the adjective Shiroi 白い).
... View more
4 hours ago
Thank you all for testing! 🙂 So I know that it isn't a problem local to my system.
@Eugene Tyson that is good information! My usual (naive?) approach is (a) I use Adobe Paragraph Composer until it gives a bad result (often!), and then (b) I switch to Adobe Single-line Composer just for that paragraph and do my best to fix it.
@Peter Kahrel thanks, that doesn't surprise me but I tried to find an existing bug report and nothing appeared in uservoice that I could find.
@Mike Witherell thanks for your comments... the demo document might be a little messy, as it was copy/pasted out part way during the cleaning up of someone else's document, but I had the paragraph styles working the way I wanted. This bug—now confirmed—appeared during a real use case and it was weird because it was easy to fix—just change almost anything: add a character, remove a character, change the table width, and the whole thing would go back to normal... only to fail again when another change triggered it again. And I couldn't find any reported instance of this issue, so I felt the need to post something here, even though I had found a workaround.
> But when would I validly do that? Override Paragraph Composer with Single Line Composer? I wouldn't do so, normally, would I?
Oh dear! This is literally what I *normally* do! See my comment to Eugene above. Is there a better way to fix a bad composition caused by Adobe Paragraph Composer?
However in the case of my demo document, it is ikely that I was fiddling around before I realised some of the parameters of the presumed-bug. But when I "Clear Overrides" on all text in the demo document, the bug is still evident.
> But if I edit the paragraph style Body to use Single-Line Composer, it functions correctly.
Yes! that is the workaround that I used. But I only needed to change the last paragraph before the span (the magenta paragraph).
> Interestingly, I notice the Heading and the Table Caption are set to Span; but the table styles are not set to span
Not too interesting... I set the Heading and Table Caption to span because they are in the text frame that has 2 columns, but the table styles—meaning the paragraph styles used for the table cells' text—don't spam because a cell doesn't have columns. As an experiment I set the table cell paragraph styles to span, but it didn't change anything, which makes sense.
I appreciate you all looking into it and confirming the bug. Thank you again!
- Mark
... View more
15 hours ago
@Js1212
The fix for this issue is available in the InDesign PreRelease build(v20.2.0.036) and above. Please check if the issue is now resolved.
Download/Update the latest InDesign PreRelease build in Creative Cloud under the “Prerelease” category(Refer to “Prerelease_CreativeCloud.png” for reference)
Please apply to the InDesign PreRelease in case you don’t have access to the InDesign PreRelease build – https://www.adobeprerelease.com/beta/C6DFA254-C40C-4EEB-8F6D-F4AEDA2E6171
If you still encounter any issues, please drop a mail to sharewithID@adobe.com.
— Adobe InDesign team
... View more
Mar 03, 2025
Hi @punit_9859, I don't know that error, and I couldn't find the equivalent file on my system (MacOS, though).
So I don't have an answer, but here are some things to try:
• uninstall Illustrator and re-install.
• setting permissions on the file or folder(s) mentioned in the error message?
• try deleting that file(!) or just move it somewhere else
- Mark
... View more
Mar 03, 2025
08:43 AM
@Jambo_88
You're welcome 🙂
... View more
Mar 03, 2025
07:41 AM
Hi Robert, No, I haven't I will try it out. Thank you!
... View more
Mar 03, 2025
02:19 AM
Une approche intéressante que j'ai personnellement utilisée il y a longtemps pour des clients. Mais j'avais déjà constaté à l'époque certaines limites d'alignement (vertical/horizontal) en lien avec la police utilisée (ici, Minion Pro) … Exemple : (^/) The Jedi
... View more
Mar 02, 2025
07:05 AM
in my quick test I did notice that app.colorTransform was returning 0..1 numbers Hi Mark, just keep in mind that the LAB color space is an exception to the rule, since it takes and returns L:0..100, a:-100..100, b:-100..100
... View more
Mar 01, 2025
12:46 PM
Alas, it was a slip of the mind, revisiting this script after about 6 or so months. Shame InDesign doesn't support such selections. Oh well. Best, Smyth
... View more
Feb 28, 2025
05:47 PM
I'm looking for a tool than can do all of this
By @abdullh_raad027_
If you can be limited to Windows - not a problem - most of your requirements are either already done or can be quickly implemented - always free of charge - in my ID-Tasker tool - but the tool itself isn't free.
Do you really need Python involved?
Or you could check https://www.siliconpublishing.com/
Or:
https://helpx.adobe.com/uk/indesign/custom-solutions.html
... View more
Feb 28, 2025
04:40 PM
> 3. Is there any workaround to enable CEP again in Illustrator 2025, or is it completely removed?
Tried and CEP is still working in Illustrator 2025 (29.3.1). Would it solve the problem if you set the PlayerDebugMode again?
CEP-Resources/CEP_11.x/Documentation /CEP 11.1 HTML Extension Cookbook.md
... View more
Feb 28, 2025
10:57 AM
I saw that after the fact.:) I get these messages out of order sometimes in my email. Fun times.
By Brad @ Roaring Mouse
Yeah. Yesterday I got a notification about messages posted 4 DAYS ago??
Or about posts that I don't follow??
... View more
Feb 28, 2025
06:36 AM
Hi Roci, this is a perfect task for Illustrator scripting. In a similar project we decided to process the files in chuncks of 100 because the performace of Illustrator was regressing.
... View more
Feb 28, 2025
03:32 AM
I tried it out @John37830937iqgg, but it seems to return the size of the clipping path, not the visual part of the clipping group. 😞
... View more
Feb 28, 2025
02:41 AM
@Joel Cherney
And you can force script to use a specific vversion of InDesign through "#target name":
https://extendscript.docsforadobe.dev/interapplication-communication/application-and-namespace-specifiers/
... View more
Feb 27, 2025
10:53 PM
Thanks for the comment... It happens that I place .ai files (rarely .indd files), but I usually only use the .ai files for vector graphics without linked images, and when I usually embed the images in the .ai file. But I will keep it in mind so that I can do an additional check with these links when I use this script.
... View more
Feb 27, 2025
12:03 PM
You're welcome!
... View more
Feb 27, 2025
08:35 AM
Hello @m1b , how are you? Thank you for responding. I'll give you a script that more or less does what I want. I mean copying only the content of several artboards without the artboards and combining them with other files in a new document, since having to open them one by one is a lot of time. I work in a printing press where many files are moved. The script only copies from one artboard and I would like it to copy from all of them. var sourceFolder = Folder.selectDialog('Selecciona la carpeta con los archivos de Illustrator a combinar'); if (sourceFolder) { var files = sourceFolder.getFiles("*.ai"); // Filtra solo archivos .ai if (files.length > 0) { // Crear un nuevo documento var destDoc = app.documents.add(); for (var i = 0; i < files.length; i++) { var sourceDoc = app.open(files[i]); var sourceArtboards = sourceDoc.artboards; // Crear una capa en el documento destino con el nombre del archivo var newLayer = destDoc.layers.add(); newLayer.name = files[i].name.replace(/\.ai$/, ''); // Iterar sobre cada mesa de trabajo en el documento fuente for (var j = 0; j < sourceArtboards.length; j++) { // Seleccionar la mesa de trabajo actual sourceDoc.artboards.setActiveArtboardIndex(j); var artboard = sourceArtboards[j]; var artboardRect = artboard.artboardRect; // Seleccionar todos los objetos en la mesa de trabajo actual app.selection = null; app.executeMenuCommand('selectallinartboard'); // Copiar los objetos seleccionados app.executeMenuCommand('copy'); // Cambiar al documento destino app.activeDocument = destDoc; // Asegurarse de que la capa nueva esté activa destDoc.activeLayer = newLayer; // Pegar el contenido en la posición correcta app.executeMenuCommand('pasteInPlace'); // Mover los objetos pegados a la posición correcta var pastedItems = destDoc.selection; var offsetX = artboardRect[0] - destDoc.artboards[0].artboardRect[0]; var offsetY = artboardRect[1] - destDoc.artboards[0].artboardRect[1]; for (var k = 0; k < pastedItems.length; k++) { pastedItems[k].translate(-offsetX, offsetY); } } // Cerrar el documento fuente sin guardar cambios sourceDoc.close(SaveOptions.DONOTSAVECHANGES); } alert('Archivos combinados en un solo documento'); } else { alert('No se encontraron archivos .ai en la carpeta seleccionada'); } } else { alert('No se seleccionó ninguna carpeta'); }
... View more
Feb 27, 2025
06:11 AM
2 Upvotes
Is it me, or does myText.parentTextFrames[0].parentPage no longer refer to the text frame containing myText?
By @Jeremy bowmangraphics
Won't work if text is overset.
... View more
Feb 27, 2025
03:26 AM
1 Upvote
Thank you, @Peter Kahrel and thanks also to you @m1b, this works well and yes, I had thought about the issue around style names eg 'MONTH1', but hadn't put a fix for that, so what you have supplied is great. Many thanks!!
... View more
Feb 27, 2025
02:40 AM
Title Case is "dumb" and doesn't understandthe nuances of style. Unfortuantely, you say this is being picked up as a variable, and Find/Change, to the best of my knowledge, will not help. Variables are, to InDesign's inner workings, a single character, not a text string.
I'm guessing here that you are using one of the Running Header Variables to accomplish this. If so, is there a reason you haven't formatted the triggering text that is being picked up by the variable to look the way you want it to appear?
One possible workaround might be to change the style used to trigger the variable to a new style used only for that purpose (and it can have no characteristics other than a unique name), then add non-printing text, perhaps in an anchored object to assure it flows with the text during editing, that has the correct capitalization. I often do something similar to create Table Of Contents entries that otherwise would not show up in the body of the work, or that need to be shortened or reformatted.
... View more
Feb 27, 2025
01:47 AM
Plugins are too complicated or scripts are convenient. Long live scripts.
... View more
Feb 27, 2025
12:16 AM
2 Upvotes
Hi @Eugene Tyson yes it is definitely possible to configure the document so that running a script will restore the relationship between page items, eg. to position the button near the answer text frame. But I can't tell if that will meet Wendy's needs.
Hi @JH-Wendy would it be possible for you to describe—from the point of view of the user—how your document would work? For example, do they open a pdf, fill out a form field with their answer to a question, then click a button to trigger the actual answer to appear? If so, what is the print document like?
Without knowing more, I'm wondering if you could set up a multi-state object in Indesign, and add in a little scripting in Acrobat to do the showing/hiding. The states would show (a) The message to the user and the answer form field and the answer submit button, (b) the answer, and (c) the print version. See quick example .indd attached. Then a script can be used to toggle between state 1 and state 3 (for printing). That's one idea anyway.
- Mark
... View more
Feb 25, 2025
10:45 PM
1 Upvote
APFS changed the order of files delivered by the operating system. Sort the result if you depend on a specific order. https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/APFS_Guide/FAQ/FAQ.html Calling readdir(2) on a directory in APFS returns filenames in hash order, whereas HFS+ returns filenames in lexicographical order.
... View more
Feb 24, 2025
03:15 PM
Hi @Utson_Avila2888 I see. Yes I hadn't expected anyone to fill or stroke a clipping mask, but I've updated my code above with a check for it. Should work correctly now.
- Mark
P.S. A couple of notes on posting code: (1) please use the </> button to format your code, and (2) if you are posting someone else's code publicly, it is impolite to remove their authorship notice.
... View more
Feb 23, 2025
10:02 PM
2 Upvotes
Hi @optimisticperson, as others have rightly said, there is no other way than adjusting by hand because Illustrator has no capability to judge properties such as the "visual weight" of an object. No doubt one day it will! Making disparate logos sit comfortably together is a task involving significant skill.
However, perhaps it would still save some time to give a rough approximation? I have written a script that scales the selected page items such that the area of each item's bounds matches the average area of all the items.
It won't do a great job, because the bounds of a logo isn't a good metric for the visual weight, but it might provide a starting point. Let me know if it is helpful.
- Mark
/**
* @file Scale To Average Area.js
*
* Scales the selection such that the area
* of each item's geometric bounds match
* the average area of the selected items.
*
* @author m1b
* @version 2025-02-24
* @discussion https://community.adobe.com/t5/illustrator-discussions/how-to-automatically-resize-a-bunch-of-logos-so-they-re-visually-proportional/m-p/15168811
*/
(function () {
var doc = app.activeDocument,
items = doc.selection;
if (0 === items.length)
return alert('Please select some items and try again.');
scaleItemsToAverageArea(items);
})();
/**
* Scales each page item in `items` such that the area
* of each item's geometric bounds match the average area
* of the selected items.
* @date 2025-02-24
* @param {Array<PageItem>} items - the items to scale.
*/
function scaleItemsToAverageArea(items) {
var areas = [],
areaSum = 0;
for (var i = 0, bounds, area; i < items.length; i++) {
bounds = getItemBoundsIllustrator(items[i], false);
area = (bounds[2] - bounds[0]) * -(bounds[3] - bounds[1]);
areas[i] = area;
areaSum += area;
}
var averageArea = Math.sqrt(areaSum) / items.length;
for (var i = 0, scaleFactor; i < areas.length; i++) {
scaleFactor = averageArea / Math.sqrt(areas[i]);
items[i].resize(scaleFactor * 100, scaleFactor * 100);
}
};
/**
* Returns bounds of item(s).
* @author m1b
* @version 2024-03-10
* @param {PageItem|Array<PageItem>} item - an Illustrator PageItem or array of PageItems.
* @param {Boolean} [geometric] - if false, returns visible bounds.
* @param {Array} [bounds] - private parameter, used when recursing.
* @returns {Array} - the calculated bounds.
*/
function getItemBoundsIllustrator(item, geometric, bounds) {
var newBounds = [],
boundsKey = geometric ? 'geometricBounds' : 'visibleBounds';
if (undefined == item)
return;
if (
item.typename == 'GroupItem'
|| item.constructor.name == 'Array'
) {
var children = item.typename == 'GroupItem' ? item.pageItems : item,
contentBounds = [],
isClippingGroup = (item.hasOwnProperty('clipped') && item.clipped == true),
clipBounds;
for (var i = 0, child; i < children.length; i++) {
child = children[i];
if (
child.hasOwnProperty('clipping')
&& true === child.clipping
)
// the clipping item
clipBounds = child.geometricBounds;
else
contentBounds.push(getItemBoundsIllustrator(child, geometric, bounds));
}
newBounds = combineBounds(contentBounds);
if (isClippingGroup)
newBounds = intersectionOfBounds([clipBounds, newBounds]);
}
else if (
'TextFrame' === item.constructor.name
&& TextType.AREATEXT !== item.kind
) {
// get bounds of outlined text
var dup = item.duplicate().createOutline();
newBounds = dup[boundsKey];
dup.remove();
}
else if (item.hasOwnProperty(boundsKey)) {
newBounds = item[boundsKey];
}
// `bounds` will exist if this is a recursive execution
bounds = (undefined == bounds)
? bounds = newBounds
: bounds = combineBounds([newBounds, bounds]);
return bounds;
};
/**
* Returns the combined bounds of all bounds supplied.
* Works with Illustrator or Indesign bounds.
* @author m1b
* @version 2024-03-09
* @param {Array<bounds>} boundsArray - an array of bounds [L, T, R, B] or [T, L , B, R].
* @returns {bounds?} - the combined bounds.
*/
function combineBounds(boundsArray) {
var combinedBounds = boundsArray[0],
comparator;
if (/indesign/i.test(app.name))
comparator = [Math.min, Math.min, Math.max, Math.max];
else
comparator = [Math.min, Math.max, Math.max, Math.min];
// iterate through the rest of the bounds
for (var i = 1; i < boundsArray.length; i++) {
var bounds = boundsArray[i];
combinedBounds = [
comparator[0](combinedBounds[0], bounds[0]),
comparator[1](combinedBounds[1], bounds[1]),
comparator[2](combinedBounds[2], bounds[2]),
comparator[3](combinedBounds[3], bounds[3]),
];
}
return combinedBounds;
};
/**
* Returns the overlapping rectangle
* of two or more rectangles.
* NOTE: Returns undefined if ANY
* rectangles do not intersect.
* @author m1b
* @version 2024-09-05
* @param {Array<bounds>} arrayOfBounds - an array of bounds [L, T, R, B] or [T, L , B, R].
* @returns {bounds?} - intersecting bounds.
*/
function intersectionOfBounds(arrayOfBounds) {
var comparator;
if (/indesign/i.test(app.name))
comparator = [Math.max, Math.max, Math.min, Math.min];
else
comparator = [Math.max, Math.min, Math.min, Math.max];
// sort a copy of array
var bounds = arrayOfBounds
.slice(0)
.sort(function (a, b) { return b[0] - a[0] || a[1] - b[1] });
// start with first bounds
var intersection = bounds.shift(),
b;
// compare each bounds, getting smaller
while (b = bounds.shift()) {
// if doesn't intersect, bail out
if (!boundsDoIntersect(intersection, b))
return;
intersection = [
comparator[0](intersection[0], b[0]),
comparator[1](intersection[1], b[1]),
comparator[2](intersection[2], b[2]),
comparator[3](intersection[3], b[3]),
];
}
return intersection;
};
/**
* Returns true if the two bounds intersect.
* @author m1b
* @version 2024-03-10
* @param {Array} bounds1 - bounds array.
* @param {Array} bounds2 - bounds array.
* @param {Boolean} [TLBR] - whether bounds arrays are interpreted as [t, l, b, r] or [l, t, r, b] (default: based on app).
* @returns {Boolean}
*/
function boundsDoIntersect(bounds1, bounds2, TLBR) {
if (undefined == TLBR)
TLBR = (/indesign/i.test(app.name));
return !(
TLBR
// TLBR
? (
bounds2[0] > bounds1[2]
|| bounds2[1] > bounds1[3]
|| bounds2[2] < bounds1[0]
|| bounds2[3] < bounds1[1]
)
// LTRB
: (
bounds2[0] > bounds1[2]
|| bounds2[1] < bounds1[3]
|| bounds2[2] < bounds1[0]
|| bounds2[3] > bounds1[1]
)
);
};
... View more
Feb 21, 2025
04:34 AM
perfect answer
... View more
Feb 20, 2025
02:20 AM
Oh, and, by the way, if you follow the recommendation 2. and copy cells instead of cell contents, you clearly copy all cell properties as well, inasmuch you won't need the step to transfer all cell properties. What you definitely should do is to transfer all column properties using this neat technique.
... View more
Feb 19, 2025
03:32 PM
@Robert at ID-Tasker you are no village idiot!—you are an expert like each of us. I have made many more errors than you have on this one thread—some quite embarassing—so on that metric I would win the village idiot olympics here.
We could, as time permits, go back and look over our contributions on a thread such as this, and analyze the contribution we made. Did our comments push forward the discussion, or side-track it?
I find it uncomfortable work, as I see all my mistakes, but it can be edifying.
- Mark
... View more
Feb 18, 2025
08:15 AM
Thanks bro, I like Illustrator and even more the scripts help a lot but I'm still not at your level to program. 😉
... View more