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

Lorem text insertion

New Here ,
Sep 19, 2010 Sep 19, 2010

hi there

i am trying to have place-holder text frame. here is my script. but the text come single line and stretched. can you help me please. appreciate your time

Thank you

Krish

if (app.documents.length > 0) {
var myTextFrame =app.activeDocument.textFrames.add();
myTextFrame.position = [200, 200]
myTextFrame.contents = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam est neque, vulputate sed consectetur eget, laoreet sed ipsum. Sed egestas elit tellus. Vestibulum sagittis iaculis ante, vel viverra nibh accumsan a. In a felis ut enim facilisis facilisis. Sed a velit et urna sodales hendrerit eu sed metus. Morbi sed nunc urna. Nulla euismod est et tortor varius mattis. Donec vel lorem vel eros mollis placerat ut eget augue. Donec nisi dui, placerat et iaculis vel, fermentum nec ligula. Nullam vehicula aliquam mauris, eu viverra odio consectetur sed. "
myTextFrame.width = 250
myTextFrame.height = 250
myTextFrame.wrapped = true
}

TOPICS
Scripting
1.1K
Translate
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
Guide ,
Sep 20, 2010 Sep 20, 2010

The method textFrames.add(); by default create point text. If you want to create area text you need to create a rectangle an pass this to area text. The guide contains samples of all these…

Translate
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 ,
Sep 22, 2010 Sep 22, 2010

enclose each line in quotations and add a carriage ruturn code at the end

not familiar with JS (I think the code is "\n"), in VB it is Char(13), it would be like this

myTextFrame.contents = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam est neque, vulputate sed consectetur eget," & Char(13) &_

"laoreet sed ipsum. Sed egestas elit tellus. Vestibulum sagittis iaculis ante, vel viverra nibh accumsan a. In a felis ut enim facilisis facilisis." & Char(13)_

sample:

Illustrator.ActiveDocument.TextFrames(1).Contents = "123" & vba.Chr(13) & "456"

result:

pointText.PNG

Translate
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
Guide ,
Sep 23, 2010 Sep 23, 2010

I was thinking more like…

#target illustrator if (app.documents.length > 0) {      var w = app.activeDocument.width;      var h = app.activeDocument.height;      var myTextRect = app.activeDocument.pathItems.rectangle(h, 0, w, h);      var myTextFrame = app.activeDocument.textFrames.areaText(myTextRect);      myTextFrame.contents = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam est neque, vulputate sed consectetur eget, laoreet sed ipsum. Sed egestas elit tellus. Vestibulum sagittis iaculis ante, vel viverra nibh accumsan a. In a felis ut enim facilisis facilisis. Sed a velit et urna sodales hendrerit eu sed metus. Morbi sed nunc urna. Nulla euismod est et tortor varius mattis. Donec vel lorem vel eros mollis placerat ut eget augue. Donec nisi dui, placerat et iaculis vel, fermentum nec ligula. Nullam vehicula aliquam mauris, eu viverra odio consectetur sed.";      myTextFrame.wrapped = true }

resulting in… Area text frame that the contents flow inside…

Picture 1.png

Translate
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 ,
Sep 23, 2010 Sep 23, 2010

that works too, now there's point text and area text samples to chose from.


Translate
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
New Here ,
Oct 01, 2010 Oct 01, 2010
LATEST

In applescript this could work:

tell application "Adobe Illustrator"

activate

make new document

make new rectangle in document 1 with properties {position:{100, 400}, width:400, height:200}

set areaText to make new text frame in document 1 with properties {kind:area text, text path:the result, contents:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam est neque, vulputate sed consectetur eget, laoreet sed ipsum. Sed egestas elit tellus. Vestibulum sagittis iaculis ante, vel viverra nibh accumsan a. In a felis ut enim facilisis facilisis. Sed a velit et urna sodales hendrerit eu sed metus. Morbi sed nunc urna. Nulla euismod est et tortor varius mattis. Donec vel lorem vel eros mollis placerat ut eget augue. Donec nisi dui, placerat et iaculis vel, fermentum nec ligula. Nullam vehicula aliquam mauris, eu viverra odio consectetur sed."}

end tell

Translate
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