Quote Originally Posted by wakawaka View Post
jml's example is a different way to accomplish it but his also formats the path so the instead of my "myfile.txt(20)", his returns "myfile (20).txt".
myfile.txt(20) is not a good format for an output file. myfile(20).txt will open up with whatever editor is associated with txt files. You'll get a dialog asking which program to open .txt(20) files which is bad UX.