renél80416020
Advocate
renél80416020
Advocate
Activity
Oct 04, 2024
11:35 PM
the same question was asked here
... View more
Oct 04, 2024
06:26 PM
1 Upvote
Hi @andyf65867865, just further to what @renél80416020 already showed you, have a look at this experiment:
I start with a new document which has one 100x100pt artboard (see attached demo.pdf), and run this script:
/**
* Experiment showing positions using different
* coordinate systems and ruler origins.
*
* Note that the `position` of each of the four
* triangles is set to [0,0].
* @author m1b
* @discussion https://community.adobe.com/t5/illustrator-discussions/how-to-place-an-object-at-specified-document-coordinates/m-p/14897332
*/
(function () {
var doc = app.activeDocument,
layer = doc.activeLayer,
artboard = doc.artboards[0];
// make some triangles just for showing positions
var docTriangle = drawTriangle(layer),
docTriangleZeroed = drawTriangle(layer),
artboardTriangle = drawTriangle(layer),
artboardTriangleZeroed = drawTriangle(layer);
// give colors to distinguish
docTriangle.fillColor = doc.swatches[4].color;
docTriangleZeroed.fillColor = doc.swatches[5].color;
artboardTriangle.fillColor = doc.swatches[6].color;
artboardTriangleZeroed.fillColor = doc.swatches[7].color;
// keep these so we can clean up afterwards
var originalCoordinateSystem = app.coordinateSystem,
originalDocRulerOrigin = doc.rulerOrigin,
originalArtboardRulerOrigin = artboard.rulerOrigin;
// position the document coordinates triangle
app.coordinateSystem = CoordinateSystem.DOCUMENTCOORDINATESYSTEM;
doc.rulerOrigin = [30, 20];
docTriangle.position = [0, 0];
// position the artboard coordinates triangle
app.coordinateSystem = CoordinateSystem.ARTBOARDCOORDINATESYSTEM;
artboard.rulerOrigin = [30, 20];
artboardTriangle.position = [0, 0];
// position the document coordinates (zeroed) triangle
app.coordinateSystem = CoordinateSystem.DOCUMENTCOORDINATESYSTEM;
doc.rulerOrigin = [0, 0];
docTriangleZeroed.position = [0, 0];
// position the artboard coordinates (zeroed) triangle
app.coordinateSystem = CoordinateSystem.ARTBOARDCOORDINATESYSTEM;
artboard.rulerOrigin = [0, 0];
artboardTriangleZeroed.position = [0, 0];
// clean up (leave document settings how we found it)
app.coordinateSystem = originalCoordinateSystem;
doc.rulerOrigin = originalDocRulerOrigin;
artboard.rulerOrigin = originalArtboardRulerOrigin;
})();
/**
* Makes a right-angle triangle path item.
* @param {Document|Layer|GroupItem} container - where to put triangle.
* @param {Number} size - the size, in points, of the triangle.
* @returns {PathItem}
*/
function drawTriangle(container, size) {
size = size || 10;
var triangle = container.pathItems.add();
// note y-axis goes negative in Illustrator
triangle.setEntirePath([[0, 0], [size, 0], [0, -size]]);
triangle.closed = true;
triangle.filled = true;
triangle.stroked = false;
return triangle;
};
I get this result:
If you have a careful look at that you will see that artboard coordinates go from topleft [0,0] with positive Y down, but document coordinates go from bottom left [0,0] with positive Y up. Note that each time I have set the position of each triangle to [0,0], so the change in positions is solely due to coordinateSystem and rulerOrigin.
In your own scripts, my suggestion is—just as my script does here—to explicitly control both the app.coordinateSystem, and either the doc.rulerOrigin, or the artboard.rulerOrigin (depending on the coordinateSystem you choose). And don't forget to clean up afterwards!
- Mark
... View more
Oct 04, 2024
12:46 PM
Bonjour, Sélectionnez "Extrémité projetée" René
... View more
Oct 04, 2024
11:30 AM
great, thanks for participating
... View more
Sep 30, 2024
04:22 AM
Hello @dacantrell86, I have sent you a DM. Kindly check. Thanks, Anubhav
... View more
Sep 30, 2024
01:16 AM
Are you in Edit mode in Photos? Those are crop handles. They are not part of the image itself.
... View more
Sep 25, 2024
07:56 AM
Thanks Mark 🙂 You are welcome
... View more
Sep 23, 2024
08:18 AM
Envelopes need to be prepared in a specific way: https://youtu.be/AXMHWDRcv_g
... View more
Sep 15, 2024
04:45 PM
Thanks
... View more
Sep 13, 2024
06:03 AM
Select your Text Object shape. Next, Object>Text Wrap>Text Wrap Option Uncheck Invert Wrap K
... View more
Sep 11, 2024
12:48 PM
1 Upvote
Sélectionnez le segment à l'aide de l'outil de sélection directe (A) puis activez la touche Suppr. Valable pour tout type de segment.
... View more
Sep 10, 2024
03:59 AM
Bonjour, Couleurs Indique le nombre de couleurs à utiliser pour un résultat de vectorisation en couleurs. Si vous avez sélectionné la Bibliothèque de documents comme palette, vous pouvez choisir une nuance. (Cette option est disponible seulement lorsque le mode est défini sur Couleur.) Gris Indique le nombre de nuances de gris à utiliser pour un résultat de vectorisation en gris. (Cette option est disponible seulement lorsque le mode est défini sur Niveaux de gris.) Seuil Spécifie une valeur pour la génération d’un résultat de vectorisation en noir et blanc à partir de l’image d’origine. Tous les pixels plus clairs que la valeur définie dans la zone de texte Seuil sont convertis en blanc, tandis que les pixels plus foncés sont convertis en noir. (Cette option est disponible seulement lorsque le mode est défini sur Noir et blanc.) Tracés Contrôle la distance entre la forme reproduite et la forme du pixel d’origine. Les valeurs basses ajustent le tracé de plus près, alors que les valeurs élevées ont l’effet inverse. Angles Spécifie l’emphase sur les angles. Une valeur plus élevée correspond à davantage d’angles. Bruit Spécifie une zone de pixels à ignorer pendant la vectorisation. Une valeur plus élevée correspond à moins de bruit. Mode Indique une méthode de vectorisation. L’option Recouvrement crée des tracés découpés tandis que l’option Chevauchement crée des tracés empilés. Fonds Crée des zones avec fonds dans le résultat de vectorisation. Contours Crée des contours dans le résultat de vectorisation. Contour Spécifie l’épaisseur maximale possible des contours dans l’image d’origine. Les contours dont l’épaisseur est supérieure à la valeur maximale sont affichés sous forme de zones vectorisées dans le résultat de vectorisation. Magnétisme des courbes par rapport aux lignes Permet de remplacer des courbes légères par des lignes droites. Ignorer le blanc Indique si les zones à fond blanc sont remplacées par des zones sans fond. Activez l’aperçu dans le panneau Vectorisation de l’image pour afficher un aperçu du résultat avec les paramètres actuels. René
... View more
Sep 10, 2024
02:01 AM
Distorsion de l'enveloppe > Créer d'après un filet... Utilisez l'outil de sélection directe (A) pour ajuster selon les guides René
... View more
Sep 06, 2024
07:52 AM
Posting this here for anyone who, like me, wants Sanzo Wada's colors from A Dictionary of Color Combinations, using the CMYK values listed in the book (Seigensha edition published 2024). Google Drive link to the .ase file
... View more
Sep 06, 2024
02:36 AM
Bonjour, Pour contourner la chose: Avec Options png Pour couleur d'arrière plan, choisir autre... René
... View more
Aug 30, 2024
01:35 AM
@Lee33781706mrwr schrieb:
This doesn't work at all in Photoshop which is the app i have, not illustrator.
Then you are posting in the wrong forum.
Please go there for Photoshop: https://community.adobe.com/t5/photoshop-ecosystem/ct-p/ct-photoshop?page=1&sort=latest_replies&lang=all&tabid=all
... View more
Aug 28, 2024
11:45 AM
Hi! Does it works with freeform gradients ?
... View more
Aug 27, 2024
01:55 AM
@Ghulam Mohyuddin the 'Flare' tool can be found with the 'Geometric Shapes' in addition to what @renél80416020 is also explaining the definition of the halos as well!
... View more
Aug 25, 2024
01:35 PM
Bonjour Paul, En suppriment le rectangle devenu inutile? L'application tierce c'est quoi? René
... View more
Aug 25, 2024
10:18 AM
2 Upvotes
On peut le faire avec les outils d'Illustrator en partant d'un polygone. René
... View more
Aug 08, 2024
01:12 AM
It works 😃 Thanks, I really have memories of this working differently. Maybe it's a Mandela effect type of situation. Thank you very much!
... View more
Aug 06, 2024
01:16 AM
Bonjour Nomar, Il faut ajouter l'option suivante: options.saveMultipleArtboards = true; par exemple après la ligne options.resolution = 1200; René
... View more
Jul 27, 2024
09:03 AM
Merci beaucoup! Works fine!
... View more
Jun 10, 2024
03:29 AM
1 Upvote
@Stefan Rakete
The list of font names is taken from the document metadata XMP, so it will only be correct when the document is saved.
Probably closing and opening it again is a way to be sure that the XMP is up-to-date. I sometimes substitute that by checking Document.saved.
... View more
Apr 02, 2024
12:15 AM
You are so awesome, I admire you!!!
... View more
Mar 01, 2024
01:01 PM
Bonjour, C'est pourtant simple: Sélectionnez les objets Touche de raccourci <o> 1 Clic sur un des points situés sur l’axe de symétrie par exemple le point C (si vous avez tracé un axe de symétrie clic sur l"axe). 2 Faire glisser vers la droite <MAJ>+<ALT> Ou encore plus simple: Clic sur le point C appuyez sur <ALT> et clic sur un deuxième point D. Même méthode si l'axe est incliné. Avec un axe clic à deux endroits sur l'axe (1 <ALT> puis 2) Remarque: l'axe n'appartient pas à la sélection, cela peut être un segment d'un tout autre objet.
... View more
Feb 26, 2024
07:59 PM
4 Upvotes
Hi @Brian32453879u67v (and others), I am late to this thread, but I've done a fair bit of this type of thing before, so I've put together a function that, given one or more text frames, will space the text (by adjusting leading) so that the space between lines is an exact amount. Not tested much at all at this stage. See how it goes.
- Mark
/**
* @file Set Space Between Text Lines.js
* Demonstrates `setSpaceBetweenTextLines` function.
* Usage: select one or more text frames and run script.
* @author m1b
* @discussion https://community.adobe.com/t5/illustrator-discussions/illustrator-word-spacing-script/m-p/14439010
*/
(function () {
var doc = app.activeDocument,
textFrames = doc.selection;
if (0 === textFrames.length)
return alert('Please select one or more text frames and try again.');
var spacing = prompt('Enter line spacing amount, in points:', 0);
if (
null !== spacing
&& !isNaN(Number(spacing))
)
setSpaceBetweenTextLines(doc, textFrames, Number(spacing));
})();
/**
* Given a text frame, will adjust leading
* so the distance between glyphs on each line
* matches `spacing` value.
* @author m1b
* @version 2024-02-27
* @param {Document} doc - an Illustrator Document.
* @param {TextFrame|Array<TextFrame>} textFrame - the text frame to adjust, or array of text frames.
* @param {Number} [spacing] - the desired spacing, in points, between lines (default: 0).
*/
function setSpaceBetweenTextLines(doc, textFrame, spacing) {
spacing = spacing || 0;
if ('Array' === textFrame.constructor.name) {
// handle array of textFrames
for (var i = 0; i < textFrame.length; i++)
setSpaceBetweenTextLines(doc, textFrame[i], spacing);
return;
}
else if (!textFrame.hasOwnProperty('story'))
throw Error('setSpaceBetweenTextLines: bad `text` supplied.');
if ('TextFrame' !== textFrame.constructor.name)
textFrame = textFrame.story.textFrames[0];
// set the leading to absolute
convertToAbsoluteLeading(textFrame);
// add extra gap between lines
textFrame.textRange.leading += 100;
// get the outlined text grouped into lines
var outlines = outlineTextLines(doc, textFrame.duplicate());
for (var i = 1, y1, y2; i < outlines.length; i++) {
y1 = outlines[i - 1].geometricBounds[3];
y2 = outlines[i].geometricBounds[1];
// set text line's leading
textFrame.lines[i].leading += (y2 - y1) + spacing;
}
// clean up
for (var i = outlines.length - 1; i >= 0; i--)
outlines[i].remove();
};
/**
* Returns `textFrame` converted into outlines, grouped into "lines".
* NOTE: `textFrame` will be destroyed.
* @author m1b
* @version 2024-02-27
* @param {Document} doc - an Illustrator Document.
* @param {TextFrame} textFrame - a TextFrame.
* @returns {Array<GroupItem>}
*/
function outlineTextLines(doc, textFrame) {
var leadings = Array(textFrame.lines.length),
groups = Array(textFrame.lines.length);
// create a group for each line
for (var i = 0; i < textFrame.lines.length; i++) {
leadings[i] = textFrame.lines[i].leading;
groups[i] = doc.groupItems.add();
groups[i].move(textFrame, ElementPlacement.PLACEBEFORE);
}
var outlines = textFrame.createOutline(),
items = outlines.pageItems,
leadingPositions = [];
// get the bottom of each line (top of bounds to bottom of leading)
for (var i = 0, bottom = outlines.geometricBounds[1]; i < leadings.length; i++) {
bottom -= leadings[i];
leadingPositions.push(bottom);
}
// collect each item into its line
// by comparing bottom of outlined character
// against bottom of leading
itemsLoop:
for (var i = items.length - 1, y; i >= 0; i--) {
y = items[i].geometricBounds[3];
leadingsLoop:
for (var j = 0; j < leadings.length; j++) {
if (y > leadingPositions[j]) {
items[i].move(groups[j], ElementPlacement.PLACEATEND);
// lines[j].push(items[i]);
continue itemsLoop;
}
}
}
// remove the original group
outlines.remove();
return groups;
};
/**
* Sets the text frame's leading
* to an absolute value.
* @param {TextFrame} textFrame
*/
function convertToAbsoluteLeading(textFrame) {
var oldLeading = textFrame.textRange.leading;
textFrame.textRange.autoLeading = false;
textFrame.textRange.leading = oldLeading;
};
... View more
Feb 26, 2024
02:44 PM
Bonjour René! Ouais, cela semble fonctionner dans les deux cas, mais je l'ai modifié par ce que vous avez suggéré, merci beaucoup!
... View more
Feb 23, 2024
01:12 AM
1 Upvote
Bonjour StartAG Le script fonctionne avec de objets alignés horizontalement avec une tolérance de +- 5pt, désolé, je pensais que votre exemple correspondait à ça (je l'ai édité spécialement pour l'occasion). Je constate que vous êtes assez exigeant. René
... View more