dimitri_cas
Engaged
dimitri_cas
Engaged
Activity
Feb 07, 2025
06:02 AM
Many thx Brad… 🙂
... View more
Feb 07, 2025
06:02 AM
Hi Ton - Thx, but… not what I'm looking for. Cheers
... View more
Feb 07, 2025
06:02 AM
Hi Monika 🙂 Thx for you answer. I don't have an account on this website, so yes please, could you add it? Many thx, enjoy (soon) your week-end. - Dimitri
... View more
Feb 04, 2025
04:52 AM
Hello Monika - In attachment the demo file. Thx.
... View more
Feb 04, 2025
02:37 AM
1 Upvote
Hello - Yes, is “Separations Preview” buggy? It sure looks like it to me (and it doesn't matter if you're working with the latest version of Illustrator or not, I've gone all the way back to version 2023). Context: I have a dynamic symbol, in which I have the yellow part in “yellow (CYMK). One of the advantages of a dynamic symbol is that you can change its appearance without changing the symbol itself. In this case, I'm changing its color to a Pantone color (outside the symbol, ie. once it's been placed on an artboard). It works. However, when I check the color separations, it doesn't show the Pantone (applied outside the symbol), but the basic CMYK yellow included in the symbol. Strangely enough, when I draw a shape (eg. a rectangle) on the artboard, Pantone is shown in the separations! Strange, isn't it? Is it a visualization bug or am I missing something here? Thx, enjoy your day. Cfr. the uploaded screenshots. - Dimitri
... View more
Nov 12, 2024
07:26 AM
Hey sttk3 - Thx for your answer and your time. - Dimitri
... View more
Nov 12, 2024
03:10 AM
Hello - Apparently, there is a Javescript "menu comand" to HIDDEN the artboards, but what about to SHOW the artboards? Since also apparently the menu command "app.executeMenuCommand("artboard");" seems to hidden the artboards. Thank you, - Dimitri
... View more
Oct 22, 2024
08:10 AM
1 Upvote
Hey sttk3 - Thanks for the clarification 😉 Here is my Illustrator Javascript adapted (later I'll "couple" it w/ a button to make is easier to use (in my case)): // Ensure something is selected
if (app.documents.length > 0 && app.selection.length > 0) {
var selectedItem = app.selection; // app.selection is already a TextRange when selecting characters
// Check if the selected item is a TextRange
if (selectedItem.typename === "TextRange") {
try {
// Apply the font "Geomanist Medium" to the selected text range
selectedItem.characterAttributes.textFont = app.textFonts.getByName("Geomanist-Medium");
} catch (e) {
alert("The font 'Geomanist Medium' is not available on your system.");
}
} else {
alert("Please select a portion of text using the Type Tool.");
}
} else {
alert("Please open a document and select some text.");
}
... View more
Oct 22, 2024
04:19 AM
Hi - I try to write a small Adobe Illustrator Javascript that (when called) changes the "weight" of some selected text (eg. Bold to Medium). Precision: Text selection is made with the "Type Tool" (NOT the "Selection Tool"). NB. The script works when a whole textfield is selected w/ the "Selection Tool" I always get the following error "Error 21: undefined is not an object." on line 35/36 (cfr. screenshot) Here is my code: // #targetengine miscellaneous;
#target Illustrator
#targetengine main
// Ensure something is selected
if (app.documents.length > 0 && app.selection.length > 0) {
var selectedItem = app.selection[0];
alert(selectedItem);
// Check if the selected item is text (whether it's a range or text frame selection)
if (selectedItem.typename === 'TextRange' || selectedItem.typename === 'TextFrame') { // item.typename === 'TextFrame' && (item.kind === TextType.POINTTEXT || item.kind === TextType.AREATEXT)) {
// if (typeof selectedItem === "TextRange" || selectedItem === "TextFrame") {
try {
// Change the font of the selected text (works for both TextRange and full TextFrame)
selectedItem.textRange.characterAttributes.textFont = app.textFonts.getByName("Geomanist-Medium");
} catch (e) {
alert("The font 'Geomanist Medium' is not available on your system.");
}
} else {
alert("Please select some text using the Type Tool or select a text frame.");
}
} else {
alert("Please open a document and/or select some text.");
}
... View more
Oct 22, 2024
04:14 AM
Bonjour René 🙂 Je ne m'explique pas trop le souci. Probablement avez vous raison… Merci.
... View more
Oct 17, 2024
01:37 AM
Hi Mark 🙂 Salut René renél80416020 Here we go, a PDF (Illustrator editable) with the wrong/incorrect behaviour of the script
... View more
Oct 17, 2024
01:24 AM
Hi Mark - Salut René renél80416020 Thanks to both of you for your help. Strangely enough, currently I can't reproduce the "wrong behaviour" of the script (ie. That it flipped not to 0° the placed item, instead of just resetting the rotate value to 0°). And I don't know why… 😛 If I still encounter the "wrong behaviour" I'll post the file (PDF) as requested 😉 Thanks again, and both of you, enjoy your day. - Dimitri
... View more
Oct 16, 2024
08:30 AM
Hi again 🙂 It works in most of the cases… Now I just had a case were the value was "Rotate: 176.52°" And the script didn't reacted correctly, placed item was like flipped vertically and not really at 0°… - Dimitri
... View more
Oct 14, 2024
11:06 PM
Salut René 🙂 Hi Mark m1b 🙂 Last script from René is exactly what I'm looking for. For now, it works like a charm (in most of the cases, see next message). Two both of you a BIG thx (merci), for your time, explanations and your expertise. Enjoy your day… - Dimitri
... View more
Oct 11, 2024
08:04 AM
Hi… The one from "Sky Chaser High" OK… Pretty good, but here too, it resets all the transformations, not only the "rotate value" 😕
... View more
Oct 11, 2024
08:00 AM
Hi Mar k--The last one, the most "robust" as you said Doesn't work too Sorry… You written findRotationByMinimalBounds(item) " But what/where the "item" in your code? thx
... View more
Oct 11, 2024
07:55 AM
This one doesn't work, it resets all the transformation. Not only the "rotate value"
... View more
Oct 10, 2024
07:51 AM
Hello René - OK, mais cela fait quoi en résumé? Car la version de Kurt semble fonctionner correctement. Merci pour votre intervention 🙂 - Dimitri
... View more
Oct 10, 2024
07:50 AM
Hi Kurt 🙂 It works perfectly fine (for now). A sh*t, It reset everything. I only need the "roate value" to be reset (nothing else). Thanks a lot enjoy your day. - Dimitri
... View more
Oct 08, 2024
04:46 AM
Hi m1b - Thanks for your reply. First way/option seems to work perfectly 😉 It worked well the first time, I tried already in another document on another placed image and it didn't work. The seoncd time, result is quite similar than mine… 😞 Thx again. Enjoy your day. - Dimitri
... View more
Oct 08, 2024
01:20 AM
2 Upvotes
Hi - I try to make a very "simple" Adobe Illustrator Javascript based on the below script (I found it somewhere years ago on internet, tbh can't remeber where). The script should simply reset to zero (0°) the "rotate" value of the current selected placed item. I tried already a lot of stuff, but can't make it works :-P: I found information like "app.getRotationMatrix(…)". But yeah… How to make it work? 🤷🏻 Here is the source code (base), not the final script: selection = app.activeDocument.selection;
for (i=0; i<selection.length; i++) {
if(selection[i].typename == "TextFrame" || selection[i].typename == "PlacedItem" || selection[i].typename == "RasterItem") {
get_matrix = selection[i].matrix;
if(selection[i].typename == "PlacedItem")
get_matrix = concatenateScaleMatrix(get_matrix, 100, -100);
invMatrix = invertMatrix(get_matrix);
invMatrix.mValueTX = 0;
invMatrix.mValueTY = 0;
selection[i].transform(invMatrix);
}
} I tried something (w/ the help of ChatGPT), visually we are close to a result, but the placed item rotate value is just not reset to "zero" (0°): function resetPlacedItemRotation() {
var myDoc_DC = app.activeDocument;
var IMG_selected = myDoc_DC.selection;
if (IMG_selected.length === 0) {
alert("Please select a placed item.");
return;
}
for (var i = 0; i < IMG_selected.length; i++) {
var item = IMG_selected[i];
if (item.typename === "PlacedItem") {
var confirmReset = confirm("Do you want to reset the rotation for the selected placed item?");
if (confirmReset) {
// Get the current transformation matrix
var currentMatrix = item.matrix;
// Calculate the current rotation angle in degrees
var currentRotation = Math.atan2(currentMatrix.mValueB, currentMatrix.mValueA) * (180 / Math.PI);
// Apply the exact opposite of the current rotation
var rotationToApply = -currentRotation; // Opposite direction
// Rotate around the center of the placed item
item.rotate(rotationToApply, true, true, true, true, Transformation.CENTER);
alert("Rotation has been reset to 0° by applying " + rotationToApply.toFixed(3) + "°.");
} else {
alert("Operation canceled.");
}
} else {
alert("Selected item is not a placed item.");
}
}
}
resetPlacedItemRotation(); Thank you, Enjoy your day, - Dimitri
... View more
Sep 25, 2024
07:56 AM
Thanks Mark 🙂 You are welcome
... View more
Sep 25, 2024
06:12 AM
1 Upvote
Hi… At the end, I made it works 🙂 NB. I make use of "BridgeTalk()" & Photoshop must be open (even It's a Illustrator script) Here is the script: #target Illustrator
#targetengine main
var myPaletteTest_XPOS = 1150;
var myPaletteTest_YPOS = 30;
// PALETTE
// =======
var myPaletteTest = new Window('palette', 'DC TOOLS');
myPaletteTest.orientation = "column";
myPaletteTest.alignment = "center";
myPaletteTest.alignChildren = ["center", "top"];
myPaletteTest.spacing = 1;
myPaletteTest.margins = 2;
var button100 = myPaletteTest.add('button', undefined, "Show Scale & Rotation", {name: "button100"});
button100.alignment = ["center", "top"];
myPaletteTest.frameLocation = [myPaletteTest_XPOS, myPaletteTest_YPOS];
myPaletteTest.show();
// BUTTON
// =======
button100.addEventListener('mousedown', function () {
// Use BridgeTalk to target Photoshop
var btTest = new BridgeTalk();
btTest.target = "photoshop";
// Send a BridgeTalk message to Photoshop to execute the scale/rotation function in Illustrator
btTest.body = "var btIllustrator = new BridgeTalk();\n" +
"btIllustrator.target = 'illustrator';\n" +
"btIllustrator.body = 'showScaleAndRotation();';\n" +
"btIllustrator.send();";
// Send the message to Photoshop, which will in turn trigger Illustrator
btTest.send();
});
// Function to show a dialog with SCALE & ROTATION (of aplaced image)
// =======
function showScaleAndRotation() {
var IMG_selected = app.activeDocument.selection;
// Check if something is selected
if (IMG_selected.length === 0) {
alert("Please select an object.");
return;
}
var selectedItem = IMG_selected[0];
// Check if it's a linked image (PlacedItem) or a raster image (RasterItem)
if (selectedItem.typename !== "PlacedItem" && selectedItem.typename !== "RasterItem") {
alert("The selected object is not a linked or raster image.");
return;
}
// Get the transformation matrix of the selected object
var matrix = selectedItem.matrix;
// Calculate the scaling based on the transformation matrix
var scaleX = Math.sqrt(matrix.mValueA * matrix.mValueA + matrix.mValueB * matrix.mValueB) * 100;
var scaleY = Math.sqrt(matrix.mValueC * matrix.mValueC + matrix.mValueD * matrix.mValueD) * 100;
// Calculate the rotation in degrees
var rotation = Math.atan2(matrix.mValueB, matrix.mValueA) * (180 / Math.PI);
// Show the result in a dialog box
alert("Rotation: " + rotation.toFixed(2) + "°\n" +
"Scale X: " + scaleX.toFixed(2) + "%\n" +
"Scale Y: " + scaleY.toFixed(2) + "%\n");
}
... View more
Sep 25, 2024
06:10 AM
Thanks Mark 🙂 Enjoy your day…
... View more
Sep 23, 2024
05:13 AM
Hi mark - I changed "palette" to "dialog"… It worked with a simple script. But I really have to work w/ "palettes" instead of "dialog" (which aren't the same as you). Whe you write "Palettes are more involve to get working and will need some extra code." What do you mean , where can I find some info/examples, … Thank you, regards, - Dimitri
... View more
Sep 22, 2024
03:01 AM
pas de souci René 🙂 Merci encore
... View more
Sep 21, 2024
10:10 PM
Bonjour René - Donc comme écrit cela fonctionne avec "dialog". Mais cette fenêtre "dialog" pose problème au lancement d'Illustrator (car je l'ai placé dans "Startup Scripts") et je suis obligé de clicquer sur "esc" pour poursuivre le lancement d'Illustrator (cette fenêtre disparait donc). Et le but (si cela fonctionne) est de garder en permanence ce "bouton" pour connaitre rapidement et facilement les "transformations" d'une "image placée"… C'et pour cela que j'étais parti sur l'option d'une "palette" vs. un "dialog". Une suggestion? • Comment faire autrement. • Pourquoi cela ne fonctionne pas dans ne "palette"? • … Merci, belle journé eà vous. - Dimitri
... View more
Sep 21, 2024
07:40 AM
Merci René… 🙂
... View more
Sep 20, 2024
09:04 AM
Hi charu 🙂 Thx, for your reply. Unfortunately, after updating the script by yours, quitting Illustrator and relaunch it, well Illustrator is stuck at launch after displaying the small "new dialog window" (but I can click on the button). Strange…
... View more
Sep 20, 2024
08:10 AM
Hi Mark - Thanks for your reply. I did that (in the script), closed and reopen Illustrator. Since then Illustrator is stuck at launch 😕 Really stange…
... View more