Quantcast
Channel: Adobe Community: Message List - InDesign Scripting
Viewing all articles
Browse latest Browse all 37788

Delete character in file names

$
0
0

Hi,

 

I need a help to rename some of the files. i.e. delete some characters of a files.

 

eg. XX_5182179_ETERNITY_25TH_MB_AB_XYX_abc.ttjs

eg. XX_4182229_ETERNITY_21TH_MB_AB_XYX_abc.ttjs


 

like above eg. i have lot of files on a folder in desktop.

 

and I just want to retain only the blue highlighted text. and remove characters inbetween.  i.e. XX_51312179.ttjs.

 

I have this script.. but not doing nothing..

 

 

 

var myDoc = app.activeDocument;

 

var myPath = myDoc.filePath;

var myNEWName = (myDoc.name.replace(".indd",".ps"));

var myDc = new File(myPath+"/"+myNEWName); myDoc.save(myDc);

myDoc.saveACopy(myDc);

 

 

Please help me to achieve this..

 

 

Many thanks


Viewing all articles
Browse latest Browse all 37788

Trending Articles



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