changing file names on the fly

Klaus on-rev klaus at major.on-rev.com
Tue May 17 08:46:31 CDT 2011


Hi Eva,

> Is there a way to alter file names in a directory (from a MC script, not manually)? :-) 
> 
> I have hundreds of images of which the name has to be changed slightly. 
> For example:
> anim1_Angle1.00_  9.png
> must be changed to (space deleted):
> anim1_Angle1.00_9.png

yes, use the "rename" command:
Put the filename into a variable -> tFilenameOld
put tFileNameOld into tFileNameNew
Modify/fix it as needed:
set itemdel to "/"
replace " " with "" in item -1 of tFileNameNew
rename" file tFileNameOld to tFileNameNew 

You get the picture :-)

> Eva

Best

Klaus

--
Klaus Major
http://www.major-k.de
klaus at major.on-rev.com




More information about the metacard mailing list