• I want to thank all the members that have upgraded your accounts. I truly appreciate your support of the site monetarily. Supporting the site keeps this site up and running as a lot of work daily goes on behind the scenes. Click to Support Signs101 ...

Looking for any script writers

myront

Dammit, make it faster!!
I have a free script that I found and would like to modify the code. I messed around a bit but can't seem to get what I'm after. I'm more familiar with vbs.
Any "scripters" here.
 

netsol

Premium Subscriber
my unix (sco 5 & redhat 7 +8) programmer tried an experiment the other day and asked copilot to
write him a couple scripts. SURPRISINGLY, he found that he only had to "touch up" the finished
product a bit to make it usable
 

WildWestDesigns

Active Member
my unix (sco 5 & redhat 7 +8) programmer tried an experiment the other day and asked copilot to
write him a couple scripts. SURPRISINGLY, he found that he only had to "touch up" the finished
product a bit to make it usable
That's because of MS and their being behind TS as well as Co-Pilot I would imagine. But that's me speculating.
 

myront

Dammit, make it faster!!
Ok, been working with Copilot for a few hours. Works great but cannot, for the life of me, get the height of my created rectangle to size height properly. Seems no matter what mod I or Copilot does to the calculation, either it ends with doing the opposite or stays the same.
 

myront

Dammit, make it faster!!
What generally, or specifically, are you trying to do? Is this in Illustrator?
Yes, illustrator.
Think I got it worked out. Bounding box of text is different than if the text is outlined. So script to outline text first then do the rest.

WeedLines.jsx

// Check if there are any selected objects
if (app.selection.length > 0) {
// Group the selection first
app.executeMenuCommand("group");
app.executeMenuCommand("outline");

var selectedItems = app.selection;
var minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;

// Calculate the combined bounding box of the grouped shapes as a whole
for (var i = 0; i < selectedItems.length; i++) {
var item = selectedItems;
var bounds = item.visibleBounds;
minX = Math.min(minX, bounds[0]);
minY = Math.min(minY, bounds[1]);
maxX = Math.max(maxX, bounds[2]);
maxY = Math.max(maxY, bounds[3]);
}

// Increase the bounding box width by 0.1 inch and height by 0.1 inch (converted to points, where 1 inch = 72 points)
var widthIncrement = 0.1 * 72;
var heightIncrement = .1 - 72 / 2; // Correct height increment

minX -= widthIncrement / 2;
maxX += widthIncrement / 2;
minY -= heightIncrement /2; // Decrease minY to extend downward
maxY += heightIncrement /2; // Increase maxY to extend upward

// Create a new layer for the rectangle and lines
var layer = app.activeDocument.layers.add();
layer.name = "Rectangle and Lines";

// Create the rectangle with increased dimensions
var rectangle = layer.pathItems.rectangle(maxY, minX, maxX - minX, maxY - minY);
rectangle.filled = false; // No fill
rectangle.stroked = true;
rectangle.strokeColor = app.activeDocument.swatches.getByName("Black").color;

// Create the vertical line segment
var verticalLine = layer.pathItems.add();
verticalLine.setEntirePath([[minX + (maxX - minX) / 2, maxY], [minX + (maxX - minX) / 2, minY]]);
verticalLine.stroked = true;
verticalLine.strokeColor = app.activeDocument.swatches.getByName("Black").color;

// Create the horizontal line segment
var horizontalLine = layer.pathItems.add();
horizontalLine.setEntirePath([[minX, minY + (maxY - minY) / 2], [maxX, minY + (maxY - minY) / 2]]);
horizontalLine.stroked = true;
horizontalLine.strokeColor = app.activeDocument.swatches.getByName("Black").color;

// Ungroup the selection at the end
app.executeMenuCommand("ungroup");

// Deselect everything
app.selection = null;

}
 
Top