Line breaks with .tsv
-
It’s been a while since I used Templater - Previously I’ve linked Google Sheets and I’m sure that line breaks were carried over to AE.
I’m limited to using .tsv files but the line breaks won’t carry. I cannot use paragraph text layers, I’ve also tried using /n and /r but it doesn’t not work.
Any advice?
-
Thanks for reaching out to us. You are 100% correct that we can’t use a
/n
or/r
modifier to insert a line break when using a TSV as a Data Source. Instead, we’ll need to use a special character in conjunction with an After Effects Expression.For this example, we’ll use an asterisk ( * ) in our Data Source to designate where line breaks should be inserted. So, if we wanted text on two lines, the data would look something like this: “Lorem ipsum*dolor sit amet” (with no quotes).
Then, we’ll want to add this Expression:
thisLayer.text.sourceText.split("*").join("\r");
to the Source Text property of the text layer. This should instruct AE to search the text and replace any asterisks it finds with
/r
, which should result in a line break.You can change the asterisk to another character if needed, but hopefully, this should get us moving in the right direction. If you have any other questions or if we can help further, please don’t hesitate to reach out here or to our main support at support@dataclay.com.
Thanks and Happy Rendering!
Jeff