Majonezowy
Explorer
Majonezowy
Explorer
Activity
‎Nov 13, 2024
11:45 PM
In the color panel it seems to be OK just switch the option in the color panel to what you want to modify. It doesn't change the fact that it's a bug
... View more
‎Nov 13, 2024
11:27 PM
let them take care of it
... View more
‎Nov 12, 2024
04:21 AM
@m1b I AM SENDING A PDF WITH A MARKING OF WHICH PAGE IS GOOD FOR ME AND WHICH IS BAD (SORRY FOR MY ENGLISH and caps lock) As I wrote earlier, I simply want my script for inserting registration marks to be able to recognize when a given group of objects is rotated 180 degrees relative to another one of the same dimension/size and give it a different number even if the original design was saved outside Illustrator and does not have any metadata.
... View more
‎Nov 11, 2024
10:28 PM
hi @m1b I am attaching a pdf EDIT. I added a second example
... View more
‎Nov 11, 2024
09:26 PM
Hi @renél80416020 I need a script not specifically for this object/group of objects. Such groups are very different/have different content. At first I thought that the script would have to analyze the position of some objects or given points of an object in the group, then compare them to the rest, this is beyond my knowledge and capabilities, besides I do not know if it is not beyond the capabilities of the computer's resources when there are more such objects I am attaching a screen with sample graphics and layout. This is a file from the "client". My task is to assign a number to the whole (three digits at the registration mark) and numbering of each object/group of objects. In case the objects are the same, the numbers should also be the same, but when they are turned 180 degrees, they are not the same elements anymore. Practically 100% of cases are groups. If they are not, I do it manually so that they are.
... View more
‎Nov 08, 2024
04:19 AM
I once created a script to insert registration marks into objects. In registration marks each object is numbered. this script is able to distinguish whether an element is the same or not based on its size. When an element is the same but is turned 90 degrees, its size is different (X swapped with Y), so the script knows that these are different elements. I want it to be the same when the object is turned 180 degrees (the script must distinguish these elements not by their size because after turning 180 the size is the same)    
... View more
‎Nov 08, 2024
03:51 AM
I didn't know about tags, good method, but unfortunately it won't be useful for me. I work on files saved outside of Illustrator, so objects unfortunately don't have tags saved.
... View more
‎Nov 07, 2024
11:28 PM
hello! I have a question as in the subject, is it possible to create a script that will be able to distinguish two objects, or groups of objects, if one is turned 180 degrees relative to the other? In the case of objects different from each other there is no problem, it checks its dimension and when they are different the script knows that they are different objects, but I have a problem in the case when the objects are the same size, but are turned 180 degrees, their size is the same. Does anyone know how to do this? I even tried to ask openAI, it seemed to write something but in none of the cases was the script able to distinguish this matrix does not work sorry for my English, it is basic please help
... View more
‎Jan 24, 2023
06:36 AM
Hello. I have a quick question. I have created a script that draws something for me How can I disable the dashed line in a script? what I wrote below doesn't throw an error, but it doesn't work either line.strokeDashes = false;
... View more
‎Jan 03, 2023
02:15 AM
Hi @SumitKumar in CC 2022 and CC2023 does not work Mistake - ColorSpace is not defined. n = swatches.length, Well dry element
... View more
‎Jan 02, 2023
11:25 PM
Hi @femkeblanco ! I have another question. Is it possible to display all the color swatches in the document in a script? For example, after expanding the list, a window with all samples from the active open document/file will be displayed? Such a list can be with names only if it is to be simpler And one more thing. At the moment the code works so that each item must be in a group for it to insert crosses. Is it possible that if it also selects an element that is not in any group, it will also consider it? EDIT: I managed to write it with color - I hooked it up to the script so that it doesn't give the color name, just choose from a list. Below is the code that displays all color swatches and displays an alert when a specific color is selected var swatchList = app.activeDocument.swatches;
var w = new Window("dialog", "Lista próbek");
var swatchListGroup = w.add("group");
swatchListGroup.orientation = "column";
var swatchDropdownList = swatchListGroup.add("dropdownlist");
for(var i = 0; i < swatchList.length; i++) {
swatchDropdownList.add("item", swatchList[i].name);
}
var selectButton = swatchListGroup.add("button", undefined, "GO!");
selectButton.onClick = function() {
var cusColor = swatchDropdownList.selection.text;
alert("Color: " + cusColor);
}
w.show();
... View more
‎Dec 26, 2022
11:17 PM
Hi. I once wrote a script (using the internet) to create grids of Fefco 2xx boxes When enabled, the script looks like this: The point is that each dimension is entered manually. I wanted to present it better in the script, which dimension draws which side, so that it looks more or less like below. Is there a possibility for him to draw something already in the dialogue before running the script? the code that displays the dialog at the moment looks like thi EDIT: I managed to do it by inserting an image. Everything works. The topic can be closed
... View more
‎Dec 22, 2022
11:55 PM
Thank you for help. I don't think I can squeeze any more, we did everything I wanted 🙂 A little question from a slightly different topic. And is it possible to set the color of the created new layer. I noticed that it often creates a yellow color, it is hardly visible and I have to manually change it to any other color. I found some ready command, but it won't cooperate What do I have to enter to make the checkbox checked by default after enabling the script? The "active onclick" function does not work and any other code combination below name.onClick = function () {
restoreDefaultsButton.enabled = true;
name.active = false;
name.active = true;
}
... View more
‎Dec 19, 2022
11:49 PM
I renamed all the variables and it worked! Thank you Now I'm wondering if it is possible (maybe if) for the script to check the size of elements, and if it is smaller than, for example, 400mm, it would not insert crosses at the top and bottom, and if it is larger, it would insert it. I think it should be something like this if (formula to check the height of objects){ draw(y1 + w / 4, x - w / 4, w / 2, x, y1); // top draw(y2 + w / 4, x - w / 4, w / 2, x, y2); // bottom } I guess I'm asking too much :x
... View more
‎Dec 19, 2022
11:09 PM
Thank you for your help. I want to add what you wrote to the previous code I have, but something is changed and I can't figure out which variables are which. Middle and left and right works, while top and bottom only draw a square for (var i = 0; i < app.selection.length; i++) {
if (app.selection[i].typename == "GroupItem") {
var group = layer1.groupItems.add();
var b = app.selection[i].geometricBounds;
var y = b[1] + ((b[3] - b[1]) / 2);
var x1 = b[0] - gap - w / 2, x2 = b[2] + gap + w / 2;
var x = b[0] + ((b[2] - b[0]) / 2);
var y1 = b[1] + gap + w / 2, y2 = b[3] - gap - w / 2;
function draw(top, left, w, p, p1, p2) {
var square = layer1.pathItems.rectangle(top, left, w, w);
var l1 = layer1.pathItems.add();
l1.setEntirePath([[p - w, y], [p + w, y]]);
var l2 = layer1.pathItems.add();
l2.setEntirePath([[p, y - w], [p, y + w]]);
square.stroked = l1.stroked = l2.stroked = true;
l2.strokeWidth = l1.strokeWidth = square.strokeWidth = weight;
l2.strokeColor = l1.strokeColor = square.strokeColor = color;
l1.strokeOverprint = l2.strokeOverprint = square.strokeOverprint = l2.fillOverprint = l1.fillOverprint = true;
square.filled = l2.filled = l1.filled = false;
square.moveToEnd(group);
l1.moveToEnd(group);
l2.moveToEnd(group);
}
draw(y + w / 4, x1 - w / 4, w / 2, x1); // L
draw(y + w / 4, x2 - w / 4, w / 2, x2); // R
if (srodek.value == true){
draw(y + w / 4, x - w / 4, w / 2, x, y); // centre
draw(y1 + w / 4, x - w / 4, w / 2, x, y1); // top
draw(y2 + w / 4, x - w / 4, w / 2, x, y2); // bottom
}
//TEXT
function comp(p, content) {
var t = layer1.textFrames.pointText([x2 + w / 2, y + p]);
t.contents = content;
t.textRange.textFont = app.textFonts["MyriadPro-Regular"];
t.textRange.fillColor = color;
t.textRange.overprintFill = true;
t.moveToEnd(group);
}
comp(w / 4, input.text);
//number
if (ifnumber.value == false){
comp(- w * 3 /4, counter.text);
counter.text++;
}
}
}
... View more
‎Dec 18, 2022
10:54 PM
I have already dealt with the overprint and wrote exactly as you 🙂 As for the outline, adding what you wrote seems to have solved the problem. Thank you for help. I added a bit more to the code, added the input from which number the elements should be counted, and if I want them in the color of the additional sample, I give the name (if not, they should be black) - I'm just wondering if it can be better solved Would you be able to give me a skeleton code for drawing crosses to add them also centrally in the middle (vertical and horizontal), and at the top and bottom at 7mm distance from the object? More specifically, it's about adding a cross - a cross in the center of X and Y in line with those on the sides (as an if option, but I can handle it) - two crosses in the X axis in the center of the object, and Y at the top at a distance of 7mm from the object, and at the bottom
... View more
‎Dec 15, 2022
03:55 AM
I apologize in advance for so many posts. I'll try to include everything here. So... I extended the script with a pop-up window etc. Below it is attached. The problem is that with groups with more elements, the crosses are drawn without any outline (I attached the screen in the above post) I noticed that sometimes, despite the set thickness of 0.25mm, it will give an outline with a thickness of 1pt, or it will not make it at all. I would also like them to have the overprint fill attribute and the overprint outline turned on
... View more
‎Dec 15, 2022
01:19 AM
I noticed that when there are more colors in a group, the script can draw crosses without an outline, this is not always the case
... View more
‎Dec 14, 2022
11:02 PM
I mean that the vertical and horizontal line have a white fill, basically it doesn't bother me so let's leave this topic. It works with color change, but... I'm trying to do if - if I enter "1" in the name of the color, it should draw in black, if I enter the name of the color, it should do with this color var kolor = prompt("kolor");
if (kolor.text == "1")
{
var color = new CMYKColor();
color.black = 100;
}
else {
var color = app.activeDocument.swatches[prompt("")].color;
} And what do I need to add to enable the attribute of filling the print with the outline of the print?
... View more
‎Dec 14, 2022
01:30 PM
Sorry, my English is very basic I have added custom colors, additional samples. Is there a possibility that, for example, after entering the name of this additional color, the script will work in this selected color? I forgot the most important They must have the fill attribute and the outline of the overprint turned on.
... View more
‎Dec 14, 2022
12:32 PM
1 Upvote
It works! Two help is invaluable! One more question, it will be possible to add something to support the colors of the additional sample, i.e. if I enter the name of the additional sample in the variable, it will insert it all with this color sample?
... View more
‎Dec 14, 2022
04:19 AM
I've already converted to CMYK var color = new CMYKColor(); color.black = 100; And the code works on multiple objects though (I checked it wrong, sorry)
... View more
‎Dec 14, 2022
03:28 AM
As for the color, if they can't be the same color as the group, it's like they can be 100% black in the CMYK palette
... View more
‎Dec 14, 2022
03:27 AM
Thank you again for your help! you are great 1. yes, there should be one and the same number in the entire document, but each time the script is run, it wants to enter this number (because each project has a different number). 2. yes, it's supposed to be the number of objects. Each object should be numbered from 1 3. Myriad Pro. Regular, 12pt What you wrote works, but only on one object (despite selecting several) I forgot to add that the thickness of the crosses should be 0.25mm and that it would create a new layer called "+"
... View more
‎Dec 13, 2022
10:57 PM
Hello. I believe in the power of this forum, once a friend helped me write a script, for which I thank you again! Is anyone able to write me a skeleton script that will insert/draw crosses like in the screen for each selected grouped element? Such a cross should be 7mm in size and be at least 7mm away from the object. Both crosses should be in one line. Importantly, next to the right cross on the right side there should be the inserted text from the variable that I should enter, while at the bottom the variable counting +1 to each object (more or less like on the screen) The crosshairs should be the same color as the selected objects (usually black or a secondary swatch). Please help
... View more
‎Nov 28, 2022
01:05 AM
I wouldn't have thought to add ".text" to the variable... I've done the rest, everything works. Thank you for your help! you are great! Without you, my job would be much more difficult
... View more
‎Nov 25, 2022
04:34 AM
I'm going for the sun, but I decided to rebuild the script into a separate window where I enter all the input. For now, I've built a skeleton, but I have a problem with it, that whatever I write in the file name, it saves with the name [object Textedit] The end of the script is practically 1/1 of what you wrote and I know that it needs to be written differently, but I have no idea how. I tried a lot of things but the effect is that it either doesn't save the files at all or it saves with the name [object EditText] Could you refactor it so that it works? I immediately say that probably a lot of things may not be needed, but I'm just learning js #target illustrator
if (app.documents.length > 0) {
var doc = activeDocument;
var selectedItems = parseInt(doc.selection.length, 5) || 0;
}
(function(){
var win = new Window('dialog');
function getDocName(doc) {
var name = decodeURI(doc.name);
var lastDot = name.lastIndexOf('.');
if (lastDot > -1) return name.slice(0, lastDot);
return name;
}
var namePnl = win.add('panel', undefined, 'NAZWA PLIKU');
namePnl.orientation = 'row';
var namePrefix = win.add('edittext', undefined, fileName);
namePrefix.characters = 20;
fileName = getDocName(doc);
var patka = txtgroup(win, 'text', 'tu wpisz');
var units = win.add("checkbox", undefined, undefined, { name: "units" });
units.text = "button";
units.onClick = function () {
restoreDefaultsButton.enabled = true;
units.active = true;
units.active = false;
}
var grp = win.add('group');
var ok = grp.add('button {text: "OK"}');
grp.add('button {text: "Cancel"}');
var by = win.add('group');
by.add('statictext {text: "Save AS NEW"}');
var version = win.add('group');
version.add('statictext {text: "v0.0.1"}');
var doDraw = function(){
draw();
win.close(0);
}
ok.onClick = doDraw;
win.show();
function txtgroup(win, name ,txt) {
var grp = win.add('group');
grp.add('statictext {text: "'+name+': "}');
var item = grp.add('edittext {characters: 12, active: true}');
item.text = txt;
return item;
}
function draw(){
var myDoc = app.activeDocument;
grp = myDoc.groupItems.add();
grp.name = 'dieline';
var file1 = new File(app.activeDocument.path + "/" + namePrefix);
var AI = new IllustratorSaveOptions();
AI.compatibility = Compatibility.ILLUSTRATOR16;
var PDF = new PDFSaveOptions();
doc.saveAs(file1, AI);
doc.saveAs(file1, PDF);
return grp;
}
})();
... View more
‎Nov 23, 2022
01:11 AM
One question. I want what will be added to the file name to be at the end, you need to significantly rewrite the code? What I added, unfortunately, does not work - it does not add anything at the end of the name var name1 = prompt("NR NG:", "");
var version1 = prompt("wersja:", "");
var file1 = new File(app.activeDocument.path + "/" + name1 + app.activeDocument.name + version1);
... View more
‎Nov 21, 2022
10:42 PM
I added to the "file1" variable "app.activeDocument.name" and the script does what I needed. I didn't think it would be so simple and added unnecessary functions. Thank you very much for your help!
... View more
‎Nov 21, 2022
04:03 AM
Generally, I mean that during the execution of the script a window will appear in which you will enter what you want to add before the file name and save it in PDF and AI (cs6) format in the same folder from where it was opened Your script works ok, I changed it so that it asks where it wants to save new files every time and I have to type the whole name manually (person for AI and PDF file), but unfortunately it's a bit tedious and time consuming that it's faster to use normal " save as"
... View more