The following rename script stopped working - it makes no changes to the file name when applied - with 13.14.1
option explicit
Function Rename_GetNewName ( strFileName, strFullPath, fIsFolder, strOldName, ByRef strNewName )
Dim re
Dim strWordArray
Dim strExtension
Dim strNameOnly
' Create a RegExp object. See http://msdn2.microsoft.com/en-us/library/ms974570.aspx
Set re = new RegExp
re.IgnoreCase = True ' Case-insensitive matching.
re.Global = True ' All matches will be replaced, not just the first match.
' If we're renaming a file then remove the extension from the end and save it for later.
if fIsFolder or 0 = InStr(strFileName,".") then
strExtension = ""
strNameOnly = strFileName
else
strExtension = Right(strFileName, Len(strFileName)-(InStrRev(strFileName,".")-1))
strNameOnly = Left(strFileName, InStrRev(strFileName,".")-1)
end if
' Apply our regular expression to the filename.
' This replaces dots, unless they are between numbers.
re.Pattern = "([^0-9])\.|\.([^0-9])"
strNameOnly = re.Replace(strNameOnly, "$1 $2")
' Also replace underscores and dashes with spaces.
re.Pattern = "[-_]"
strNameOnly = re.Replace(strNameOnly, " ")
' Rejoin the name and extension and we're finished
strNewName = strNameOnly & strExtension
End Function
Appreciate any help!