You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//This script is an example of parsing csv file into AE compsfunctionfindCompByName(compName){for(vari=1;i<=app.project.numItems;i++){if(app.project.item(i).name==compName&&app.project.item(i)instanceofCompItem)returnapp.project.item(i);}returnnull}vartextFile=File.openDialog("Выберите файл с данными (.csv)","*.csv");if(textFile!=null){vartextLines=newArray();textFile.open("r","TEXT");}while(!textFile.eof){textLines.push(textFile.readln());}
Copy file name to clipboardExpand all lines: csvreader_final.jsx
+1
Original file line number
Diff line number
Diff line change
@@ -0,0 +1 @@
1
+
//This script is an example of parsing csv file into AE compsfunctionfindCompByName(_name){for(vari=1;i<=app.project.numItems;i++){if(app.project.item(i).name==_name&&app.project.item(i)instanceofCompItem)returnapp.project.item(i);}returnnull}functionfindLayerByName(_name,_comp){for(varl=1;l<=_comp.layers.length;l++){if(_comp.layers[l].name==_name)return_comp.layers[l];}returnnull;}functionfindEffectByName(_name,_layer){//looks for an effect with given name inside given layervareff=_layer.property("ADBE Effect Parade");for(vare=1;e<=eff.numProperties;e++){if(eff.property(e).name==_name)returneff.property(e);}returnnull;}functiongetFolder(_name){//function for gettin a specific foldervarbFolder;for(vari=1;i<=app.project.numItems;i++){if(app.project.item(i).name==_name&&app.project.item(i)instanceofFolderItem)bFolder=app.project.item(i);}//if ther is no such folder, add itif(!bFolder)bFolder=app.project.items.addFolder(_name);returnbFolder}vartextFile=File.openDialog("Choose a csv file","*.csv");if(textFile!=null){vartextLines=[];textFile.open("r");}while(!textFile.eof){//reading file into linestextLines.push(textFile.readln());}vartemplate=findCompByName("info_template");//reference compvarbFolder=getFolder("broadcast");app.beginUndoGroup("tst");for(vart=1;t<textLines.length;t++){varnewComp=template.duplicate();newComp.name="info_"+String(t);newComp.parentFolder=bFolder;varinfoName=findLayerByName("name",newComp).property("ADBE Text Properties").property("ADBE Text Document");varinfoRegion=findLayerByName("region",newComp).property("ADBE Text Properties").property("ADBE Text Document");varinfoNumber=findEffectByName("amount",findLayerByName("number",newComp)).property("ADBE Slider Control-0001");varinfoLine=textLines[t].split(',');infoName.setValue(infoLine[0]);infoRegion.setValue(infoLine[1]);infoNumber.setValueAtTime(infoNumber.keyTime(2),Number(infoLine[2])/100000);}app.endUndoGroup();
Copy file name to clipboardExpand all lines: separateBrushes.jsx
+1
Original file line number
Diff line number
Diff line change
@@ -0,0 +1 @@
1
+
//snippet to separate brushes into different layers//CC-BY, Nik Ska, 2014varseparateBrushes=this;separateBrushes.separate=function(_removeOrigin){varactiveComp=app.project.activeItem;if(activeComp&&activeCompinstanceofCompItem){varsel=activeComp.selectedLayers;if(sel){//getting first selected layer brushesvarbrushes=sel[0].property("ADBE Effect Parade").property("ADBE Paint").property("ADBE Paint Group");if(brushes){app.beginUndoGroup("Separating brushes");for(vari=1;i<=brushes.numProperties;i++){//first we duplicate a layervarnewLayer=sel[0].duplicate();newLayer.name+=(' - '+brushes.property(i).name);//now getting its brushesvarnewLayerBrushes=newLayer.property("ADBE Effect Parade").property("ADBE Paint").property("ADBE Paint Group");//cycling though brushes and removing the ones we don't needfor(varj=brushes.numProperties;j>0;j--){if(j!=i)newLayerBrushes.property(j).remove()}}//disabling original layersel[0].enabled=false;//or removing itif(_removeOrigin)sel[0].remove();app.endUndoGroup();}}}}separateBrushes.separate(false)
0 commit comments