Skip to content

Instantly share code, notes, and snippets.

@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
@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 / sort-text-with-corresponding-number-data.js
Created Nov 20, 2018
After Effects 2019 Data-driven Expression- Sort text with corresponding number data
View sort-text-with-corresponding-number-data.js
var examples = [
{
'text' : thisComp.layer("Data-Driven-Sample.csv")("Data")("Outline")("Text Data")("Text Data 0"),
'number' : parseInt(thisComp.layer("Data-Driven-Sample.csv")("Data")("Outline")("Number Data")("Number Data 0"))
},
{
'text' : thisComp.layer("Data-Driven-Sample.csv")("Data")("Outline")("Text Data")("Text Data 1"),
'number' : parseInt(thisComp.layer("Data-Driven-Sample.csv")("Data")("Outline")("Number Data")("Number Data 1"))
},
{
@MarissaJ
MarissaJ / sort-column-numbers-ascending.js
Created Nov 20, 2018
After Effects 2019 Sort Column Numbers Ascending
View sort-column-numbers-ascending.js
values = [];
for(i=0;i<=thisComp.layer("Data-Driven-Sample.csv")("Data")("Number of Rows")-1;i++) {   
  values.push(thisComp.layer("Data-Driven-Sample.csv")("Data")("Outline")("Number Data")("Number Data " + i).value);
} values.sort((a, b) => a - b);
@MarissaJ
MarissaJ / sort-column-numbers-descending.js
Created Nov 20, 2018
After Effects 2019 Sort Column Numbers Descending
View sort-column-numbers-descending.js
values = [];
for(i=0;i<=thisComp.layer("Data-Driven-Sample.csv")("Data")("Number of Rows")-1;i++) {   
  values.push(thisComp.layer("Data-Driven-Sample.csv")("Data")("Outline")("Number Data")("Number Data " + i).value);
} values.sort((a, b) => b - a);
@MarissaJ
MarissaJ / color-hex-expression
Created Nov 20, 2018
After Effects 2019 Color Hex Value Expression
View color-hex-expression
colorText=thisComp.layer("Data-Sample.csv")("Data")("Outline")("Color Data")("Color Data 0").toString();
hexToRgb(colorText);
@MarissaJ
MarissaJ / last-value-in-column.js
Created Nov 20, 2018
Get the last entry in a column
View last-value-in-column.js
rows =thisComp.layer("Data-Sample.csv")("Data")("Number of Rows")+1;
last_val= 0;
for(i=0;i<rows;i++) { if(thisComp.layer("Data-Sample.csv")("Data")("Outline")("Number Data")("Number Data " + i))
{
Math.max(last_val= thisComp.layer("Data-Sample.csv")("Data")("Outline")("Number Data")("Number Data " + i)); } } last_val;
@MarissaJ
MarissaJ / data-row-number.js
Last active Nov 20, 2018
After Effects Data Driven Expressions- Display Data Based on Row Number
View data-row-number.js
n=Math.round(thisComp.layer("Data-Sample.csv")("Data")("Number of Rows"));
values = [];for(i=n-1;i<=n-1;i++)
{     values.push(thisComp.layer("Data-Sample.csv")("Data")("Outline")("Text Data")("Text Data " + i).value); }
values;