I'm planning to write a macro that reads the lines of a tab-delimited file and performs a Search and Replace System Clipboard action for every line of the file, using the first and second column of every line as Find and Replace string respectively, and the third column to set the 'kind of search to run'.
So the file would have the structure:
red\tgreen\searchType
Where searchType would be:
- sc for case sensitive searching of a string
- si for case insensitive searching of a string
- rc for case sensitive searching of a regular expression
- ri for case insensitive searching of a regular expression
- wc for case sensitive searching of a word
- wi for case insensitive searching of a word
- wa for case adaptive searching of a word
- wt for toggling the case of a word
Search types 1 - 4 are KM's default search types for the Search and Replace System Clipboard action:
Search type 5 and 6 would be searching with regular expressions, wrapping the search text with ''\b" to force word boundaries. Search type 7 would adapt the replacement string to the content of the clipboard: red would become green, Red would become Green, and RED would become GREEN, when the third column of the line contains wa.
Example of a file with replacement items:
Is there any user of KM who already has such a macro (or parts of it) on shelf and would be willing to share it?