Insert text a set number of characters in from left side of selected file names#default:script// This script inserts text into the selected file names at the character position you specify// Last modified by John Zeman on May 8, 2010Rename TO="{DlgStringS|Enter the number of filename characters from left\n(the text insertion point)\n\n a comma\n\nand then the text to insert|2,Text to Insert}"@nodeselect @script vbscriptoption explicitFunction Rename_GetNewName ( strFileName, strFullPath, fIsFolder, strOldName, ByRef strNewName ) Dim intComPos ' Location of the leftmost comma in dialog box entry Dim strText ' Extracted Text from dialog box entry Dim strCount ' Extracted number (of places from left) from dialog box entry ' Find the leftmost comma intComPos = InStr(strNewName,",") if intComPos > 0 then strCount = Trim(Left(strNewName, intComPos-1)) strText = Right(strNewName,Len(strNewName)-intComPos) end if Dim Dots Dots = "" Dim I I = 0 While I < CInt(strCount) Dots = Dots & "." I = I+1 Wend Dots = "(" & Dots & ")" Dim regex ' Create a RegExp object Set regex = new RegExp regex.Pattern = Dots & "(.*)" strNewName = regex.Replace(strFileName, "$1" & strText & "$2") 'End Function