• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
4

Creating labels with changing information

Community Beginner ,
Nov 13, 2023 Nov 13, 2023

Copy link to clipboard

Copied

Good morning community,

Been trying to figure out how I could automate or even reduce the time on my nameplates when changing the names. This is a daily task and would like to simplify it more, possibly automate (mail merge).

RIght now I am individually changing the name and then clicking the text (shift/click the box) then clicking on the box again to align to that. Is there a way to select all the text and conform it to the exact center of all the boxes?

See attached file on what I am working with. Have searched/watched many videos but nothing that showed what I am trying to achieve.

Please advise,

Thanks

TOPICS
How-to , Scripting , Tools

Views

566

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Nov 13, 2023 Nov 13, 2023

Copy link to clipboard

Copied

Can you perhaps provide a sample Illustrator file that shows the initial situation as well as what you want to achieve?

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 14, 2023 Nov 14, 2023

Copy link to clipboard

Copied

Hello Kurt,

Thanks for the reply did you need the .ai file or just a visual of what I am doing? 

I'm attaching screenshot of illustrator file, let me know if you actually need the .ai

So the names circled in red on the left of the artboard have been copied/pasted into the file, so I can change the names, easier.

-Can I just copy/paste the new names into the existing? If so how to keep centered inside the box (red outline).

-Is there a way to center all the text to these boxes in the file?

-End goal would be some way of just pasting/importing new names in place of the old, like a mail merge.

Please let me know if you need any other information 

Thank you

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 14, 2023 Nov 14, 2023

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 21, 2023 Nov 21, 2023

Copy link to clipboard

Copied

Hey Ton,

Yes I am going to play around with variables again, since I was not able to get the result I wanted, last time I used it.

Setting up the variables correctly to achieve just changing names without have to re-align anything. 

I may have to set it up where I have all the text as the same thing (word) to make this work. 

Thanks for the reply and suggestion, I believe this is the route I need to go

-BH

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 21, 2023 Nov 21, 2023

Copy link to clipboard

Copied

Let us know if it works Brandon. There are people here on this forum with more experience with variables than me.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 21, 2023 Nov 21, 2023

Copy link to clipboard

Copied

I do this in InDesign, and have linked text boxes for each nameplate. I can then just paste into any text box and all will reflow. You could do this in Illustrator also if you set up text containers that are linked, just will take longer as you need to manually link each text container.

 

Screen Shot 2023-11-21 at 10.40.31 AM.jpg

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 01, 2023 Dec 01, 2023

Copy link to clipboard

Copied

LATEST

Does InDesign have a fit-text-to-frame option for reducing the long names to fit (as shown in OP’s attachment)?

 

There’s GREP tricks or third-party scripts if not:

 

https://www.youtube.com/watch?v=TFzWt_hrS-A

 

https://www.youtube.com/watch?v=CACgHaM2RRA

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 27, 2023 Nov 27, 2023

Copy link to clipboard

Copied

Adjust the position of the placed text around the centre of the nearest path.
How about we make the text selected, so that you can adjust the appearance of the text yourself for any discrepancies caused by fonts?

 

↓script

var doc = app.activeDocument;
app.executeMenuCommand("deselectall");

for (var i = 0; i < doc.textFrames.length; i++) {
var oText = doc.textFrames[i];

var nearestpathItems;
var nearestDistance = Number.MAX_VALUE;
for (var j = 0; j < doc.pathItems.length; j++) {
var oPath = doc.pathItems[j];
var d = dist([oText.position[0] + oText.width / 2, oText.position[1] - oText.height / 2], oPath.geometricBounds);
if (d < nearestDistance) {
nearestDistance = d;
nearestpathItems = oPath;
}
}
ipos1 = nearestpathItems.left + (nearestpathItems.width - oText.width) / 2
ipos2 = nearestpathItems.top - (nearestpathItems.height - oText.height) / 2
oText.position = [ipos1, ipos2];
oText.selected = true
}

function dist(point1, rect) {
var x1 = point1[0], y1 = point1[1];
var x2 = rect[0] + (rect[2] - rect[0]) / 2, y2 = rect[1] - (rect[1] - rect[3]) / 2;
return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 27, 2023 Nov 27, 2023

Copy link to clipboard

Copied

If you want to place it in the centre, this is the place to do it.
However, it is not a very beautiful method as it creates a dummy object.
(The dummy object is erased, so there is no problem with the finished product.)

 

↓script

var doc = app.activeDocument;
app.executeMenuCommand("deselectall");

for (var i = 0; i < doc.textFrames.length; i++) {
var oText = doc.textFrames[i];

var nearestpathItems;
var nearestDistance = Number.MAX_VALUE;
for (var j = 0; j < doc.pathItems.length; j++) {
var oPath = doc.pathItems[j];
var d = dist([oText.position[0] + oText.width / 2, oText.position[1] - oText.height / 2], oPath.geometricBounds);
if (d < nearestDistance) {
nearestDistance = d;
nearestpathItems = oPath;
}
}
odummy = oText.duplicate()
odummy = odummy.createOutline()
iHeight = odummy.height
odummy.remove()

ipos1 = nearestpathItems.left + (nearestpathItems.width - oText.width) / 2
ipos2 = nearestpathItems.top - (nearestpathItems.height - iHeight) / 2
oText.position = [ipos1, ipos2];
oText.selected = true
}

function dist(point1, rect) {
var x1 = point1[0], y1 = point1[1];
var x2 = rect[0] + (rect[2] - rect[0]) / 2, y2 = rect[1] - (rect[1] - rect[3]) / 2;
return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines