femkeblanco
Guide
femkeblanco
Guide
Activity
‎Dec 14, 2020
10:54 AM
This is awesome! Thank you very much. All I have to do now is to ensure that all numbers are on the same layer. So I remove any text from the layer and Bingo! Thanks
... View more
‎Dec 10, 2020
06:57 AM
umm.. thanks for caring ab me but I forgave the copy&paste thing n just made the same layers lol..
... View more
‎Dec 07, 2020
12:06 PM
Yeah, thanks guys, all great stuff. I used to write everything in applescript because it was relatively easy modified English and I only used Macs, but now I have to use PCs for work. I can edit js, and add in a few bits and pieces for my needs, but writing from scratch takes me aeons, i just don't get the syntax - sorry, old dog. But I'm going to take a look at these resorces - thanks again.
... View more
‎Dec 03, 2020
02:41 PM
2 Upvotes
Set what to mm? Stroke weight? If so, change the 1 in front of strokeWidth (lines 7 and 10) to 2.83465.
... View more
‎Dec 03, 2020
05:34 AM
Thank you very much works perfect!!!!
... View more
‎Dec 01, 2020
05:43 PM
1 Upvote
working!!!! Thank you thank you so much!! This is lifesaver!
... View more
‎Dec 01, 2020
07:43 AM
2 Upvotes
I played with it a couple of years ago, I got busy and never finished the project...but the way I approached my spaghetti was to first add a dummy item to all empty sub layers. Then I could loop though every pageItem and be able to tell where every sublayer was.
But that was before absoluteZOrderPosition existed, it made things a lot easier.
... View more
‎Nov 29, 2020
03:54 PM
2 Upvotes
Alternatively, this will increase every number higher than the selected number by one. var frames = app.activeDocument.textFrames;
var x = 0;
for (var i = 0; i < frames.length; i++) {
if (selection[0] == frames[i]) {
x = i;
break;
}
}
for (var i = 0; i < frames.length; i++) {
if ((Number(frames[i].contents) >= Number(frames[x].contents)) &&
frames[i] != frames[x]) {
frames[i].contents = Number(frames[i].contents) + 1;
}
}
... View more
‎Nov 25, 2020
07:33 AM
I didn't see it in the list either, so I just experimented a little, I got lucky with the menu name.
... View more
‎Nov 24, 2020
06:16 AM
Hey friends. I understand you're a little tired of me. But I have a really last request. The code does not work in the cs6 version I have in the workplace I work. Is there a way to adjust it?
... View more
‎Nov 23, 2020
11:13 AM
@Berezin_Illustrator There was an oversight in the above script. It copied all pageItems, so it copied groups and separately copied paths within groups, i.e. it copyed grouped-paths twice. (The same with compound paths.) This should rectify that: // "copy-n-paste" pageItems
// from open docs named 1, 2, 3, ... , n
// to corresponding layers in new untitled doc
var docs = app.documents;
var docNames = [];
for (var i = 0; i < docs.length; i++) {
docNames.push(docs[i].name);
docNames.sort();
}
var targetDoc = app.documents.add();
for (var i = docNames.length - 1; i > -1; i--) {
docs[docNames[i]].activate();
var layer1 = targetDoc.layers.add();
layer1.name = docNames[i];
label: for (var j = 0; j < app.activeDocument.pageItems.length; j ++) {
var item = app.activeDocument.pageItems[j];
if (item.parent.typename == "GroupItem" ||
item.parent.typename == "CompoundPathItem") {
continue label;
}
item.duplicate(targetDoc.layers[docNames[i]]);
}
}
... View more
‎Nov 22, 2020
04:53 AM
Today I found this property and I think it would be helpful for your needs:
compoundPath.pathItems[0].polarity
compoundPath.pathItems[1].polarity
and so on …
... View more
‎Nov 19, 2020
01:21 PM
Just checking: you are also considering the path from the XMP manifest entry? (Sorry I don't have time to test right now, but I assume you have.)
... View more
‎Nov 18, 2020
12:16 PM
Works great, and I managed to puzzle out how to add 1000th or subtract 1000th in separate scripts. Thanks again!
... View more
‎Nov 18, 2020
06:19 AM
It is perfect, thank you!
... View more
‎Nov 17, 2020
06:06 AM
Thank you for your code, I will try it and post back Panagiotis
... View more
‎Nov 08, 2020
05:22 AM
Because of work reasons, an AI file needs to be exported to many different TIF folders, so you need to manually select the export location
... View more
‎Nov 04, 2020
10:00 AM
I see, you have to make the shape to be able to query its Area.
here's a script that adds the offset path, you can delete it after getting the area if you don't need it.
Select ONE shape before running
// apply offset path to selected pathItem
//https://community.adobe.com/t5/illustrator/illustrator-javascript-count-area-with-offset/td-p/11564739?page=1
function main () {
var idoc = app.activeDocument;
var sel = idoc.selection[0];
app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
var mm = 72/25.4;
var offset = 5*mm;
// offset path Effect with Round Joins
var xmlstringOffsetPath = '<LiveEffect name="Adobe Offset Path"><Dict data="R mlim 4 R ofst value I jntp 2 "/></LiveEffect>'; // 0 = round, 1=bevel, 2=miter
xmlstringOffsetPath = xmlstringOffsetPath.replace("value", offset);
idoc.selection = null;
var dup = sel.duplicate(sel, ElementPlacement.PLACEAFTER);
try {
dup.filled = false;
}
catch(e) {}
dup.selected = true; // select it before applying effects
// apply offset path Effect
dup.applyEffect(xmlstringOffsetPath);
app.redraw();
// expand appearance
app.executeMenuCommand ('expandStyle');
app.userInteractionLevel = UserInteractionLevel.DISPLAYALERTS;
}
main();
Carlos
... View more
‎Nov 03, 2020
01:44 AM
1 Upvote
The documentation is terrible, and in some ways getting worse as I don't think there's even been an official update for AI since 2017 - I guess all their efforts are being directed towards UXP. So it's pretty much been left to the community! The best resources I've found are the open-source community-contributed docs here: https://docsforadobe.dev/ Then @CarlosCanto updates these forums with everything new he is able to reverse engineer from each release: https://community.adobe.com/t5/illustrator/what-s-new-in-illustrator-scripting-cc2021/m-p/11530254?page=1#M249127 https://community.adobe.com/t5/illustrator/what-s-new-in-illustrator-scripting-cc2020/td-p/10772375?page=1 https://community.adobe.com/t5/illustrator/what-s-new-in-illustrator-scripting-cc2019/m-p/10086254?page=1#M110027 https://community.adobe.com/t5/illustrator/what-s-new-in-illustrator-scripting-cc2018/td-p/9422236?page=1
... View more
‎Oct 30, 2020
08:14 PM
Please try to give a bit more information about what you want to achieve... for example 1) are they always circles? or any collection of paths? 2) always just 7 circles? or any number? If always 7 circles always in that perfect configuration, the circle can be calculated easily. The circumcircle.jsx script doesn't work on multiple paths, including compoundPaths so it won't help without major changes.
... View more
‎Oct 29, 2020
07:22 AM
1 Upvote
Yes, this corresponds to the pathfinder effect in the effect menu and applies an effect, an appearance attribute, which would then need expanding. There is no counterpart to the pathfinder panel in ExtendScript.
... View more
‎Oct 26, 2020
11:46 AM
1 Upvote
Same goes for this code @Charu Rajput , works perfect! Now I understand the difference between app.document and app.activeDocument. Rookie mistakes 😛 Thank you very much!!
... View more
‎Oct 26, 2020
10:55 AM
Thank you! -- Matthew
[ private informations removed by moderator for security reasons ]
... View more
‎Oct 22, 2020
05:20 PM
2 Upvotes
I'm late, but here is my easy-to-make version. var d = app.activeDocument.artboards[0].artboardRect;
var paths = app.activeDocument.pathItems;
var circle1 = paths.ellipse(d[3]/2+250, d[2]/2-250, 500, 500);
var polygon1 = paths.polygon(d[2]/2, d[3]/2, 250, 12);
polygon1.rotate(15);
var points1 = polygon1.pathPoints;
var group1 = app.activeDocument.groupItems.add();
for (var i = 0; i < points1.length; i++) {
for (var j = 0; j < points1.length; j++) {
var line1 = paths.add();
var points2 = [points1[i].anchor, points1[j].anchor];
line1.setEntirePath(points2);
line1.moveToEnd(group1);
}
}
var group2 = group1.duplicate();
group2.resize(70.7, 70.7);
group2.rotate(15);
var group3 = group2.duplicate();
group3.resize(73.2, 73.2);
var group4 = group3.duplicate();
group4.resize(70.7, 70.7);
group4.rotate(15);
... View more
‎Oct 22, 2020
07:32 AM
So here is what I ended up with. You must click on the first document tab to begin. This code centers the artboard, embeds any linked/placed objects, prints, saves and closes each document from left to right (with respect to document tabs) until complete. Thanks for everyone's help! app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS; while (documents.length > 0) { executeMenuCommand("fitin"); app.activeDocument.print() for (var i = 0; i < app.activeDocument.placedItems.length; i ++) { app.activeDocument.placedItems[i].embed(); } app.activeDocument.save() app.activeDocument.close() if (app.documents.length > 0){ app.documents[app.documents.length-1].activate();} }
... View more
‎Oct 20, 2020
03:44 PM
1 Upvote
This is a basic idea: var groups = app.activeDocument.groupItems;
var d = app.activeDocument.artboards[0].artboardRect;
rect1 = app.activeDocument.pathItems.rectangle(d[1], d[0], d[2], -d[3]);
app.executeMenuCommand( "selectall" );
app.executeMenuCommand( "group" );
groups[0].rotate(-90);
app.executeMenuCommand( "deselectall" );
rect1.selected = true;
app.executeMenuCommand( "setCropMarks" );
app.activeDocument.artboards[0].remove();
app.executeMenuCommand( "selectall" );
app.executeMenuCommand( "ungroup" );
app.executeMenuCommand( "deselectall" );
... View more
‎Oct 13, 2020
12:50 PM
1 Upvote
I don't have a clue, who knows. If you find out, please fill us in!
... View more
‎Oct 13, 2020
06:38 AM
See Charu's suggestion below: https://community.adobe.com/t5/illustrator/can-someone-please-give-me-a-script-that-changes-the-ruler-metric/m-p/11286198?page=1#M185500
... View more
‎Oct 09, 2020
01:10 PM
16 means CS6 and not "Legacy"
And IMHO "Legacy" means something like previous CC versions. But maybe I'm wrong.
... View more
‎Oct 07, 2020
02:45 PM
If you want to do User interface design, then Illustrator is the wrong app anyway. You want to try out Adobe Xd, which is a new app with a new core.
I highly doubt that illustrators will move to Sketch or Figma when these don't have the relevant functionality and probably will never get it. Also: CMYK.
... View more