Copy link to clipboard
Copied
How can we create PathText for Ellipse shape and Rectangle shape Using Script?
var contents = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
var idoc = app.activeDocument;
var rect = idoc.pathItems.rectangle(-10, 10, 100, 100);
var tframe1 = idoc.textFrames.pathText(rect, 0.5, 3.5); // startTValue = 0.5, endTValue = 3.5
tframe1.contents = contents;
// fit text to path
while(tframe1.lines[0].characters.length < tframe1.characters.length) {
tframe1.textRange.characterAttributes.horizontalSca
...
Copy link to clipboard
Copied
var idoc = app.activeDocument;
var rect = idoc.pathItems.rectangle (-10, 20, 80, 50); // top, left, width, height
var tframe = idoc.textFrames.areaText (rect);
tframe.contents = "Lorem \nIpsum";
var ellips = idoc.pathItems.ellipse (-80, 20, 80, 50);
tframe = idoc.textFrames.areaText (ellips);
tframe.contents = "Lorem \nIpsum";
Copy link to clipboard
Copied
Hey Carlos Thank you for the script, I wanted to create PathText using startTValue and endTValue for Ellipse and Rectangle.
Copy link to clipboard
Copied
Hi, show a screenshot of what you're refering to please
Copy link to clipboard
Copied
This is what I want to create using startTValue and endTValue property.
Copy link to clipboard
Copied
var contents = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
var idoc = app.activeDocument;
var rect = idoc.pathItems.rectangle(-10, 10, 100, 100);
var tframe1 = idoc.textFrames.pathText(rect, 0.5, 3.5); // startTValue = 0.5, endTValue = 3.5
tframe1.contents = contents;
// fit text to path
while(tframe1.lines[0].characters.length < tframe1.characters.length) {
tframe1.textRange.characterAttributes.horizontalScale--;
}
var ellips = idoc.pathItems.ellipse(-130, 10, 100, 100);
tframe2 = idoc.textFrames.pathText(ellips, 0.5, 3.5); // startTValue = 0.5, endTValue = 3.5
tframe2.contents = contents;
// fit text to path
while(tframe2.lines[0].characters.length < tframe2.characters.length) {
tframe2.textRange.characterAttributes.horizontalScale--;
}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now