Hmm, an interesting question.
One problem is that if you have 2 similar directories like
C:\Venerable Bede's files\
C:\Venerable Bede's stuff\
You will get
C:\Venera~1\
C:\Venera~2\
So you have to check for that.
Assuming that your folder is pretty unique, you can do the following>
1. take the long path and use string.split() to chop it up using "\" as the delimiter.
2. for each foldername in the new array remove all spaces from the name and then discard everything after the first 6 characters. (You will have to treat the drive letter and file extension separately)
3. append "~1" to the end of each foldername (where appropriate).
4. string.join() them back together again and you should have something resembling what you want.
This is just of the top of my head of course, it might be a bit more complicated than that.
I'll look into it.




Reply With Quote