Create callout box around text with arrows
Copy link to clipboard
Copied
Hi!
i Dont know were to start but i need to create a javascript for cs5 that create a stacked text with a box and outline from an existing layer text.
therefor the box need to be dynamic in size Due different texts.
colour(box, stroke,text),font, strokewidth,leading and the worst part is it needs an arrow that melts with box colour and stroke on all 4 sides( the idea is to create an rotated box on the middle of each line (box) that surronds the text and then group them.
Explore related tutorials & articles
Copy link to clipboard
Copied
Please show something
Copy link to clipboard
Copied
so, the text comes from a simple text in a layer called text,
and this is the graphics I want to make with a script, is it possible?
and more text, wider box, and the arrows or mini boxes is suppose to be in the middle wich I failed with this test.
Copy link to clipboard
Copied
**DISCLAIMER**
This is horrible code. it has lots of room for improvement. But hopefully it will point you in the right direction. If you have any questions at all i'm glad tohelp.
function test()
{
var valid = true;
var docRef = app.activeDocument;
var diamondSize = 10;
var myTextFrame = docRef.textFrames[0];
var myRect = docRef.pathItems.rectangle(myTextFrame.top,myTextFrame.left,myTextFrame.width,myTextFrame.height);
var diamondLeft = docRef.pathItems.rectangle(0,0,diamondSize,diamondSize);
diamondLeft.rotate(45);
var diamondTop = docRef.pathItems.rectangle(0,0,diamondSize,diamondSize);
diamondTop.rotate(45);
var diamondRight = docRef.pathItems.rectangle(0,0,diamondSize,diamondSize);
diamondRight.rotate(45);
var diamondBottom = docRef.pathItems.rectangle(0,0,diamondSize,diamondSize);
diamondBottom.rotate(45);
diamondLeft.left = myRect.left - diamondLeft.width/2;
diamondLeft.top = myRect.top - myRect.height / 2 + diamondLeft.height/2;
diamondTop.left = myRect.left + myRect.width/2 - diamondTop.width/2;
diamondTop.top = myRect.top + diamondTop.height/2;
diamondRight.left = myRect.left + myRect.width - diamondRight.width/2;
diamondRight.top = myRect.top - myRect.height/2 + diamondRight.height/2;
diamondBottom.left = myRect.left + myRect.width/2 - diamondBottom.width/2;
diamondBottom.top = myRect.top - myRect.height + diamondBottom.height/2;
}
test();
Copy link to clipboard
Copied
Thanks a lot, no worry if it’s not the best , i am glad for any reference at all since i don’t understand illustrator library . I will test tomorrow!
Copy link to clipboard
Copied
Use the appearance panel combined with a paragraph style for getting a editable text box with the wishes arrows. The appearance could be saved as graphic style and used for every new textfeld (do not forget - you also need a paragraph style ! )
Or you can duplicate the textframe and change the text.
Or you can save as symbol and after using the symbol: break link to symbol for editing the text.
Or creating a new textframe and duplicate the appearance through the (? destination selection ? in German: Zielauswahl ) to the new textframe.
What ever, you will need 5 minutes for creating the required appearance (see the video):
Create callout box around Illustrator text with arrows
Have fun
Copy link to clipboard
Copied
wow Brilliant!!
Copy link to clipboard
Copied
johnb36386605 schrieb
Thanks a lot, no worry if it’s not the best , i am glad for any reference at all since i don’t understand illustrator library . I will test tomorrow!
Do you have problems with the script- or the appearance-solution? Or do you need further assistance?
Or why you give no feedback?
Copy link to clipboard
Copied
No script is needed.
You only will need one paragraph style and one grafik style. But I'm not at home in the moment.