From: "Jarle Leirpoll" Received: from nmsh6.e.nsc.no ([148.123.160.200] verified) by media-motion.tv (CommuniGate Pro SMTP 6.1.0) with ESMTP id 6434506 for AE-List@media-motion.tv; Wed, 11 Apr 2018 11:29:36 +0200 X-Auth: leirpoll@online.no Received: from HPZBook17 (52.69.164.82.customer.cdi.no [82.164.69.52]) (authenticated bits=0) by nmsh6.nsc.no (8.15.2/8.15.2) with ESMTPSA id w3B9YuqS038101 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 11 Apr 2018 11:34:57 +0200 To: "'After Effects Mail List'" References: In-Reply-To: Subject: SV: AE-List Digest #16541 Date: Wed, 11 Apr 2018 11:34:56 +0200 Message-ID: <000701d3d178$5abaf940$1030ebc0$@online.no> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQMq1xGH5itVa+239DIm/pavP9DhoKFNPd3w Content-Language: no X-Scanned-By: MIMEDefang 2.78 Thanks Mathias! This works much better. But I think I may have stumbled into a limitation in MOGRTs. It seems = they don't support line breaks in text fields in Premiere, so the user will = have to split the text manually and enter in different text fields for every = line break. If I enter the following text in Premiere: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi = ut aliquip ex ea commodo consequat. This is what I get back:=20 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. So the second line is gone. Bummer.=20 I tried with both area text and point text. No luck. /jarle _________________________________ Mathias M=F6hl wrote: You can split the text at linebreaks and then apply dan=92s processing = to each of the parts separately: =97=97=97=97 txt =3D thisComp.layer("Source Text").text.sourceText; n =3D thisComp.layer("Controls").effect("Text width")("Slider"); function breakToGivenLength(txt,n){ var outStr =3D ""; var newLine =3D "" var splt =3D txt.split(" ") for (var i =3D 0; i < splt.length; i++){ if ((newLine + " " + splt[i]).length > n){ if (outStr !=3D "") outStr +=3D "\r"; outStr +=3D newLine; newLine =3D splt[i]; }else{ if (newLine !=3D "") newLine +=3D " "; newLine +=3D splt[i]; } } if (newLine !=3D ""){ if (outStr !=3D "") outStr +=3D "\r"; outStr +=3D newLine; } return outStr; } lines =3D txt.split(/|\r|\n|\x03/); for(var i=3D0; i< lines.length; i++){ lines[i]=3DbreakToGivenLength(lines[i],n); } lines.join("\n"); =97=97=97=97 Note that this still does not deal properly at tabs, for example (it = only breaks at simple line breaks but not at tabs). Cheers, Mathias