There are no problems with using file rename… Try
var myfile = File.openDialog( 'select your AI file…' );
myfile.rename( 'NEW.ai' );
So I was renaming an array of files (even if there was only one file in the array), but since the old script didn't return an error when it ran (it just disappeared the file), it must have successfully written incomplete name data. I probably have a hidden file somewhere for each time the old script errored.
Mark, it's always wonderful to learn something from you.
Hmmm, your code works fine here, win 7 cs5
both openDialog and openDlg return the same thing, the diference is the starting folder.
Mark's script works fine too.