The file name is Avatar_download_from_www.demodata.com Inception_download_from_www.demodata.com Avengers_download_from_www.demodata.com
I want a dialog box where I input the String _download_from_www.demodata.com
Then Press Enter will Remove the String from any where from the Selected File Names
Easier to remove the characters via the Rename dialog's preview list, since you'll have to do something similar just to get the text you want to remove into the clipboard:
Hi Leo
The String can be any where in the file name. I mean not in the same place.
example:
1 My Name is Khalid _download_from_www.demodata.com
2 My Name _download_from_www.demodata.com is Khalid
3 My _download_from_www.demodata.com Name is Khalid
So Rename dialog's preview list not working in this case.
Plz Notice that i said " Remove the String from any where from the Selected File Names"
I am Stuck on Confirmation. If I select Multiple file then use this button then each file wants a Confirmation "OK" . But I want the Multiple Selected File Will Works without Confirmation OK for each file. Here is the Rename Preset Code:
<?xml version="1.0" encoding="UTF-8"?>
<rename_preset autorename="yes" case="none" script="yes" type="normal" typeval="0">
<from>*</from>
<to>*</to>
<script>@script vbscript
Option Explicit
Dim Recherche, Texte, Txt
Dopus.OutputString "Script: PE4_Replace - Written by: Albator V"
Function Rename_GetNewName ( strFileName, strFilePath, fIsFolder, strOldName, ByRef strNewName )
If Len(Recherche) = 0 Then
Txt = vbcr & vbcr & "Find What? (Entries are Case Sensitive)"
Recherche = inputbox (Txt, "Replace","")
If Recherche = "" Then Exit Function
End if
If Len(Texte) = 0 Then
Txt = vbcr & "Rplace With...."& vbcr & vbcr & "You can leave this box empty for replace with nothing. String to replace : " & Recherche
Texte = inputbox (Txt, "Replace","")
End if
Dim Ext, NomFichier
If fIsFolder = False Then 'if folder, extension = nothing
Ext = Right (strFileName, Len(strFileName) - (InStrRev(strFileName, ".") - 1))
Else
Ext=""
End if
NomFichier = Left (strFileName, Len(strFileName) - Len(ext))
If Recherche = "< All >" Then
strNewName = Texte
Else
strNewName = replace(NomFichier, Recherche, Texte)
End if
strNewName = replace(strNewName, "< Nothing >", "") & Ext
End Function </script>
</rename_preset>
Trying the original, it seems to work fine as-is. It only prompts for the first file and then applies the same things to all the others. (It asks for the search string, then the replacement string, but only once for each.)
If you don't want it to prompt for the replacement string, it's a fairly simple change.
Although I would do things differently, without using a script for any of this, since you can do it in a simple, single-line button or hotkey:
Rename FINDREP PATTERN="{dlgstring|Enter text to remove:}" TO