I have just added additional information to my post
Run Macro on all files within folder. So please read it again. Step by step instruction for running this macro on all files in a directory.
- Open Advanced - Configuration - Search - Set Find Output Format, verify that setting Find Summary is checked and that the string starts with Search complete, found. If you are using a non English version of UltraEdit, remember what are the first words of this string (case sensitive!). It is not necessary to use the English string here in the configuration. Close the configuration dialog with Cancel (if nothing changed) or OK (if setting enabled).
- Click on Macro - Delete All to delete all currently loaded macros in the macro buffer. This step is not really necessary, but it makes the step by step instruction for me easier to write.
- Click on Macro - Edit Macro.
- Click on button New Macro.
- Enter as macro name CapitalizeTitles. Uncheck macro property Show Cancel dialog for this macro. The property Continue if search string not found remains checked. Press button OK.
- Switch to your browser, copy following lines into Windows clipboard, select all lines in Edit/Create Macro dialog and press Ctrl+V to replace them by the lines below.
- Code: Select all
InsertMode
ColumnModeOff
HexOff
PerlReOn
Top
Loop 0
Find "<title"
IfNotFound
ExitLoop
EndIf
Key RIGHT ARROW
StartSelect
Find Select "</"
ToCaps
EndSelect
EndLoop
Top
- Make sure there is no empty line at end of the macro source becaues that would be interpreted by UltraEdit as incorrect macro command.
- Click again on button New Macro.
- Enter as macro name CapTitlesInFiles. Uncheck macro property Show Cancel dialog for this macro. The property Continue if search string not found remains checked. Press button OK.
- UltraEdit asks you now if you want to update the modified macro CapitalizeTitles. Confirm that with clicking on button Yes.
- Switch to your browser, copy following lines into Windows clipboard, select all lines in Edit/Create Macro dialog and press Ctrl+V to replace them by the lines below.
- Code: Select all
FindInFiles "directory" "file type" ""
Loop
Find MatchCase Up "Search complete, found"
IfFound
ExitLoop
Else
NextWindow
EndIf
EndLoop
DeleteLine
SelectToBottom
IfSel
Delete
EndIf
Top
UnicodeToASCII
Loop
IfEof
ExitLoop
EndIf
StartSelect
Key END
IfSel
Open "^s"
PlayMacro 1 "Name of your macro"
CloseFile Save
EndIf
EndSelect
DeleteLine
EndLoop
CloseFile NoSave
- Change on the first line the directory string to the path of the directory containing your files. The path must end with a backslash.
- Also on first line change the file type string to *.* or *.xml or whatever is best for updating only the files with the title tags.
- If the macro should run on all files of a directory tree instead of just all files within the specified directory, insert on first line between the command FindInFiles and the directory string the parameter keyword Recursive (with an additional space between this word and the double quote character of the directory string).
- If you are not using English version of UltraEdit or you have already customized the find summary string, adapt the string Search complete, found to your string, refer to point 1 of the list.
- Replace Name of your macro and the PlayMacro command line with CapitalizeTitles as this is the name of the just before created macro.
- Make sure there is no empty line at end of the macro source becaues that would be interpreted by UltraEdit as incorrect macro command.
- Click on button Close.
- Confirm that you want to update the macro CapTitlesInFiles with clicking on button Yes.
- Use Macro - Save All to save these 2 macros into a macro file.
Now the 2 macros are ready for execution. The last created macro
CapTitlesInFiles is automatically selected as active macro. Therefore you only need to click on
Macro - Play Again to execute and it watch how UltraEdit updates now your files one after the other.