From: "=?utf-8?Q?Mathias_M=C3=B6hl?=" Received: from mail-wr0-f177.google.com ([209.85.128.177] verified) by media-motion.tv (CommuniGate Pro SMTP 6.1.0) with ESMTPS id 6434533 for AE-List@media-motion.tv; Wed, 11 Apr 2018 12:59:29 +0200 Received: by mail-wr0-f177.google.com with SMTP id l13so304247wrb.5 for ; Wed, 11 Apr 2018 04:04:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=vi+e+MuMtqY3imof7N93ZQzaJ5RukGVDgKd006Agq4c=; b=sXm1IiC5D0VYVqN9S8djewZmRXUCA5hWs2yEVbCgJJMV/nWp9zrX6uLQrTZI7FqNiR Sc7eKRb1Ip4PKxvhfsHcT9/biMnGyl9IGiN01WtGvV14tXeffewYWq8LkR/NGZW/9dFb HxO/TM6LEaLh4EZ6pcQgWI6P6zqYUwH/+iEd6p1sMEd5t5Epg5spV9nmmEXFOFfdPtEt nMbhFGnbfZhMxtkkzDM1rLPyVEEzexXFQKHyId6TiAzlRWrOfczJQ7zkNFCLUkbaGnFl RP5MNPU35fRSxevmQFnwPGvqVydHIzArRF/dpeZ6i3lS2JveLT1CpkUq4X+O4L/+SSyx ISTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=vi+e+MuMtqY3imof7N93ZQzaJ5RukGVDgKd006Agq4c=; b=nhP0kJ+bBYLgodtKnC7f0gZ0wtCOEjOKe/0QE4uZU0yALVh1tAvRHRpSFp3iDsO0Kk LkJ4tfb1NN5FglxggjhhCW7HuogRSFr5etg72vKHqg2YcNVHOWd8/NqUWKVrEOYaIonR FWocQgeIvtyh9Adj8dWNEkxIktBe/sx9d3ivBsgfYrEoiHjS5kW4qKLOSN7WeOQ7KJuV VuKcGcoHI/TctE3e1ZzL7jK48pOlOgPCNFjz6Rv0gqX0grAMLtwEwTNhzT1EvBqXFJdE CiCoSMSMotXP3k4s5aRq/2x50Z8IUVincrlg5TZXRpf1VPG1SMwa+T8E4YrxfCovsNWC vDTQ== X-Gm-Message-State: ALQs6tBRdXEPdftxO7FIVjO0mCnmboLhjt6Su38hGo5lXDh+I2cbrFjc RjgNtLviJTpn3sOdUSixW7BCkZoj X-Google-Smtp-Source: AIpwx4+d1gWUjoGEmhg1MlWYpZ6+NSZ83PbCvCHT6vsxqjbKTXHIlSeIyzV+4EvTd3gju8FCdOUmBQ== X-Received: by 10.223.225.17 with SMTP id d17mr2989875wri.51.1523444689854; Wed, 11 Apr 2018 04:04:49 -0700 (PDT) Return-Path: Received: from mathiasmac-3.fritz.box (p3EE094B0.dip0.t-ipconnect.de. [62.224.148.176]) by smtp.googlemail.com with ESMTPSA id u65sm19152wrc.72.2018.04.11.04.04.48 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Apr 2018 04:04:48 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [AE] AE-List Digest #16541 In-Reply-To: Date: Wed, 11 Apr 2018 13:04:47 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <58D60275-1DA3-4437-98B6-6F3433E0C9B6@googlemail.com> References: To: After Effects Mail List X-Mailer: Apple Mail (2.3124) Hmm, if MOGRTS are really limited that way, the only workaround that = comes to my mind is that you use another separator symbol for the = linebreaks. So the user, for example, enters=20 =E2=80=9CThis is line one and#this is line two and#a third one=E2=80=9D using the # symbol instead of a line break and then in the expression you do lines =3D txt.split(/#/); instead of lines =3D txt.split(/\r|\n|\x03/); such that it splits the text at the # symbol instead of at actual line = breaks. > On 11 Apr 2018, at 11:34, Jarle Leirpoll = wrote: >=20 > Thanks Mathias! > This works much better. >=20 > 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. >=20 > If I enter the following text in Premiere: >=20 > 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. >=20 > This is what I get back:=20 >=20 > Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do = eiusmod > tempor incididunt ut labore et dolore magna aliqua. >=20 > So the second line is gone. > Bummer.=20 >=20 > I tried with both area text and point text. No luck. >=20 > /jarle > _________________________________ >=20 > Mathias M=C3=B6hl wrote: > You can split the text at linebreaks and then apply dan=C2=92s = processing to each > of the parts separately: >=20 > =C2=97=C2=97=C2=97=C2=97 >=20 > txt =3D thisComp.layer("Source Text").text.sourceText; > n =3D thisComp.layer("Controls").effect("Text width")("Slider"); >=20 > 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; > } >=20 >=20 > lines =3D txt.split(/|\r|\n|\x03/); > for(var i=3D0; i< lines.length; i++){ > lines[i]=3DbreakToGivenLength(lines[i],n); > } > lines.join("\n"); >=20 >=20 > =C2=97=C2=97=C2=97=C2=97 >=20 > Note that this still does not deal properly at tabs, for example (it = only > breaks at simple line breaks but not at tabs). >=20 > Cheers, > Mathias >=20 >=20 > +---End of message---+ > To unsubscribe send any message to