Quantcast
Channel: Adobe Community : Discussion List - After Effects Scripting
Viewing all articles
Browse latest Browse all 2143

Sort specific Files by Name termination

$
0
0

Hello everyone ,

 

i have a comp with many type a file(png,swf....),and i want to use only the swf one ,

put them at the end and distribute them by name using the first part of the name ..

 

(00_file01.swf      01_file01.swf  02_file02.swf  03_file03.swf.........)

 

I try to do that :

...

here the others files...

...

.....

02_file02.swf

01_file01.swf

00_file01.swf   

 

i do that code for the moment but i dont know how to check the first part of the name and continue the loop...

 

 

//step01

  for (i=0;i<app.project.activeItem.layers.length;i++) {

if ((app.project.activeItem.layer(i+1).name.toLowerCase().indexOf('.swf') != -1)&& (app.project.activeItem.layer(i+1).name.split("_")[0]=="00"))

app.project.activeItem.layer(i+1).selected = true;

}

app.project.activeItem.selectedLayers[0].moveToEnd();

var Swf_00=app.project.activeItem.selectedLayers[0].index

var PosSwf00=app.project.activeItem.layer(Swf_00)

 

//#selectNone

for (i=0;i<app.project.activeItem.layers.length;i++) {

app.project.activeItem.layer(i+1).selected = false;

}

 

//step02

  for (i=0;i<app.project.activeItem.layers.length;i++) {

if ((app.project.activeItem.layer(i+1).name.toLowerCase().indexOf('.swf') != -1)&& (app.project.activeItem.layer(i+1).name.split("_")[0]=="01"))

app.project.activeItem.layer(i+1).selected = true;

}

 

app.project.activeItem.selectedLayers[0].moveBefore(PosSwf00);

var Swf_01=app.project.activeItem.selectedLayers[0].index

 

 

//step03

  for (i=0;i<app.project.activeItem.layers.length;i++) {

if ((app.project.activeItem.layer(i+1).name.toLowerCase().indexOf('.swf') != -1)&& (app.project.activeItem.layer(i+1).name.split("_")[0]=="02"))

app.project.activeItem.layer(i+1).moveBefore(app.project.activeItem.layer(Swf_01));

}


Viewing all articles
Browse latest Browse all 2143

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>