Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 93817

Re: Re: Script for batch delet redundant layer

$
0
0

Hi Ashram,

 

Try this.

 

var folder = Folder.selectDialog ("Select the root folder");
var myfiles = [];
var _layers = ["Job Info", "test1", "test2", "test3"];
getsubfolderfiles(folder);
for(var i =0;i<myfiles.length;i++)
{        var doc = app.open(myfiles[i],false);        for(var j=0;j<_layers.length;j++)        {            try            {                doc.layers.item(_layers[j]).remove();            }            catch(e){}        }        doc.save();        doc.close();    }
function getsubfolderfiles(folder)
{    var filelist = folder.getFiles();    for(var i =0;i<filelist.length;i++)    {        if(filelist[i] instanceof Folder)        {            getsubfolderfiles (filelist[i]);        }        else if(filelist[i] instanceof File)        {            if(filelist[i].name.indexOf(".indd") > -1){                myfiles.push(filelist[i]);            }        }    }
}

 

Regards,

Chinna


Viewing all articles
Browse latest Browse all 93817

Trending Articles



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