Skip to content

Instantly share code, notes, and snippets.

@MarissaJ
MarissaJ / smallest-value-spreadsheet-column.js
Last active Nov 20, 2018
After Effects Data Driven Expression- Smallest Value in a Spreadsheet Column
View smallest-value-spreadsheet-column.js
values = [];
for(i=0;i<=thisComp.layer("Data-Sample.csv")("Data")("Number of Rows")-1;i++) {   
  values.push(thisComp.layer("Data-Sample.csv")("Data")("Outline")("Number Data")("Number Data " + i).value);
}
Math.min.apply(null, values)
@MarissaJ
MarissaJ / largest-value-column-data.js
Last active Nov 20, 2018
After Effects Data Driven Expression- Display Largest Value in a Spreadsheet Column
View largest-value-column-data.js
values = [];
for(i=0;i<=thisComp.layer("Data-Sample.csv")("Data")("Number of Rows")+1;i++) {   
  values.push(thisComp.layer("Data-Sample.csv")("Data")("Outline")("Number Data")("Number Data " + i).value);
}
Math.max.apply(null, values)
@MarissaJ
MarissaJ / data-based-on-time.js
Last active Nov 20, 2018
After Effects Data Driven Expression- Display Column Data Based on Time
View data-based-on-time.js
values = [];
for(i=0;i<=thisComp.layer("Data-Sample.csv")("Data")("Number of Rows")+2;i++) {   
  values.push(thisComp.layer("Data-Sample.csv")("Data")("Outline")("Number Data")("Number Data " + i).value);
} v=values.join(",");
string=v;
array=string.split(",");
l=array.length;
sec=Math.floor(time/effect("Slider Control")("Slider"));
if(sec<l){
@MarissaJ
MarissaJ / Line-break-control.js
Last active Apr 22, 2021
After Effects Data Driven Expression- Line Break Control
View Line-break-control.js
row = parseInt(thisComp.layer("Data-Sample.csv")("Data")("Number of Rows")-1);
thisComp.layer("Data-Sample.csv")("Data")("Outline")("Long Text")("Long Text " + row)
txt = thisComp.layer("Data-Sample.csv")("Data")("Outline")("Long Text")("Long Text " + row);
n = effect("Line Break")("Slider");
outStr = "";
newLine = "";
splt = txt.split(" ");
for (i = 0; i < splt.length; i++){
if ((newLine + " " + splt[i]).length > n){
@MarissaJ
MarissaJ / column-data-with-spaces.js
Last active Nov 16, 2018
After Effects Data Driven Expression- Display Column Data with Spaces
View column-data-with-spaces.js
values = [];
for(i=0;i<=thisComp.layer("Data-Sample.csv")("Data")("Number of Rows")-1;i++) {   
  values.push(thisComp.layer("Data-Sample.csv")("Data")("Outline")("Text Data")("Text Data " + i).value);
} values.join(" ");
@MarissaJ
MarissaJ / column-data-line-break.js
Last active Nov 16, 2018
After Effects Data Driven Expression- All Column Data with Line Break
View column-data-line-break.js
values = [];
for(i=0;i<=thisComp.layer("Data-Sample.csv")("Data")("Number of Rows")-1;i++) {   
  values.push(thisComp.layer("Data-Sample.csv")("Data")("Outline")("Text Data")("Text Data " + i).value);
} values.join("\n");
@MarissaJ
MarissaJ / sum-total-data-column.js
Last active Nov 16, 2018
After Effects Data Driven Expression- Sum Total Spreadsheet Column Data
View sum-total-data-column.js
rows =thisComp.layer("Data-Sample.csv")("Data")("Number of Rows");
total = 0;
for(i=0;i<rows;i++) {
if(thisComp.layer("Data-Sample.csv")("Data")("Outline")("Number Data")("Number Data " + i))
{
total+= thisComp.layer("Data-Sample.csv")("Data")("Outline")("Number Data")("Number Data " + i);
}
} total;
@MarissaJ
MarissaJ / number-of-times-item-appears-in-column.js
Last active Oct 31, 2018
Display number of times an item appears in a spreadsheet column
View number-of-times-item-appears-in-column.js
values = [];
item=thisComp.layer("data 01").text.sourceText.toString();
for(i=0;i<=thisComp.layer("state-gradient.csv")("Data")("Number of Rows")-1;i++) {   
  values.push(thisComp.layer("state-gradient.csv")("Data")("Outline")("Data")("Data " + i).value);
}
values.filter(function(value){
return value === item;
}).length