RegExp Find and Replace
- MediaMonkey Add-on - by Zvezdan Dimitrijević
This is information about the new enhanced version of RegExp Find and Replace add-on for MediaMonkey v2.x-4.x. The old version of this add-on was already one of the largest MediaMonkey's add-ons that is the most powerful and flexible for finding and replacing metadata about media files. However, the new version is even 50% larger and it has added several very useful options, among others the batch execution of presets and better organization of presets.
The previous vesion of the add-on has a free access to download, but the new enhanced version is available only to those who donate to me using PayPal because I have spent too much of my time developing it. Just leave me a note about your e-mail address, if it is different than the one that you have registered at PayPal, since I am sending this version of the add-on using e-mail attachment.
If you didn't get my e-mail for a day or two after your donation, you could check your Spam folder first and, if you cannot find it in there, please send me an e-mail with the information about donation to:
. Actually, if you are a GMail user, I recommend that you put my e-mail address to your Contact list before you make donation, so that GMail will not treat my e-mail sent to you as a spam. Thanks in advance!
This add-on doesn't work with MediaMonkey v5! Actually, none add-on made for some previous version of program could work with MM5, either by me or by another authors, since MM5 has completely different programming interface than before. If you really like my add-on and think that it is essential for your work with the program, you have several possibilities:
- you could stay with MM4;
- you could ask MM developers to implement support for old add-ons in MM5;
- you could wait for me to port the add-on to MM5, but don't hold your breath.
If you decide to stay with MM4, rest assured that I will still improve and support the add-on as long as there is an interest for it.
Added: Add button to the Edit Preset dialog box which allows creating new presets based on existing ones from the Manage Presets dialog box;
Renamed: OK button to Update/Rename in the Edit Preset dialog box;
Added: ability to create groups with radio buttons in the adjustment dialog box using <Else Caption="..."> tag (the good news: groups could be nested, the bad news: groups could contain only two radio buttons);
Improved: <If> tag used in adjustment dialog boxes;
Fixed: Invert mode with VBScript (F) option;
Fixed: update of the Date Modified property of file when changing the Timestamp feld;
Removed: many redundant presets to allow faster work, but many presets now have doubled function using the new groups with radio buttons; e.g. almost all "Copy..." presets could work as old "Assign..." or "Append..." presets;
Improved: many presets.
v5.0.3 - 2017-01-07
Fixed: unneeded update of the timestamp when modifying non-tag fields (e.g. Added);
Fixed: Delete emptied folders option after moving files, all empty parent folders are now removed (until now only empty folder that contained moved media file(s) was removed, but not its empty parent folders).
v5.0.2 - 2016-04-21
Fixed: typing numerical values on keyboard in SpinEdit controls on the adjustment and Preset Settings dialog boxes (functional only in MM v18.104.22.1689 or higher);
Fixed: unnecessary display of dialog box on start-up asking if you want to install new presets after automatic adjustment of clock caused by switch in daylight saving time;
Fixed: unneeded display of confirmation dialog box when renaming presets if the begin of the preset's name already exists;
Fixed: Date and Original Date fields, now they display dates using ISO format and accept empty string for resetting the field;
Fixed: display of source/destination field in the adjustment dialog box for renamed Custom fields;
Fixed: Replace All button in the Preset Settings dialog box for presets that use bReplacing variable (mostly the presets that modify two fields at once);
Added: ability to use ID tags between Find what and Replace with strings (e.g. in the updated "Capitalize with exceptions" preset);
Added/Updated: many presets.
v5.0.1 - 2016-02-21
Fixed: toolbar buttons for batch presets;
Fixed: update of hotkeys when that option of preset is modified;
Fixed: graphical interface of some elements in the Preset Settings and Manage Presets dialog boxes for the unskinned version and unsupported skins;
Added: a few presets.
v5.0 - 2015-11-03
Added: batch execution of presets which allows modification of two or more fields at once, with ability to create multiple batches for different tasks;
Replaced: Tag Manipulation Presets menu with sub-menus for better organization, with ability to create new custom menus, so instead of one big menu with all presets you would get presets hierarchy on two menu levels;
Added: Find option with the Next/Prev buttons to the Manage Presets's dialog box (improved old Export/Import dialog) which allows searching for preset that contains the specified text;
Added: Match case and Regular expressions options for use with the mentioned Find option;
Added: context menu to the table in the Manage Presets dialog box with some options usable in that dialog box (Copy, Select all, Print, Word Wrap, Match case, RegEx and several sorting options, e.g. Sort all presets by menu and name);
Added: Add/Edit button to the Manage Presets dialog box;
Added: ability to apply preset using menu, hotkey or toolbar and to open the Manage Presets dialog box while the Preset Settings dialog box is still opened (if the corresponding Modeless option is turned on in the Options dialog);
Added: Choose RegExp Preset dialog box similar to the Manage Presets dialog for searching and selecting preset that is opening from the Preset Settings dialog box using the "..." button;
Added: ability to specify which action would be applied (Replace all, Keep/Select matched/replaceable) when you start some preset using menu, hotkey or toolbar (until now it was only Replace all);
Added: Keep/Select irreplaceable options;
Added: ability to apply some preset to the currently playing file using menu, hotkey or toolbar (until now it could be applied only to the selected files);
Added: Tune dialog box that is opening from the Preset Settings dialog for fine adjustment of preset parameters without messing with the long and complicated Find what/Replace with strings;
Added: inverted mode when you could find something in one field and use matched string to replace data in another field (until now it was possible to replace data only in the same field that is also used to find data) (that option is experimental and maybe I will change it in the future);
Added: test of VBScript conditions using Find what string in inverted mode;
Improved: Description text box in Preset Settings dialog box and preset adjustment dialog boxes, which is now multi-line;
Added: ability to enlarge Find what/Replace with text boxes with "^/_" buttons;
Added: ability to choose what will be displayed in the info boxes below Find what/Replace with controls: Old <Into> (Original), Old <From> (Replacement), New <Into> (Result), New <From> (useful with presets that could modify two presets at once);
Added: buttons/combo boxes with several new options (Entire/Empty/Filled/Begin/End and Field/<From>/<Into>/<Str.>/< Num.>, depending of the preset settings) that are between Find what/Into, and Replace with/From combo boxes, replacing Full buttons that was next to the Regular expression check boxes;
Replaced: Backward search direction check box with the dropdown list next to the Find Next button containing the new Find Previous command;
Replaced: |< and >| buttons with the additional spin buttons that are next to the text box showing the currently selected track;
Added: ability to use <If>, <Else> and <End If> tags in Find what/Replace with strings for conditional modification of presets using check boxes in the preset adjustment dialog boxes (similar to the new Magic Nodes add-on);
Added: ability to log information about modifications of metadata when applying presets using the Event Logger add-on;
Added/Improved: many presets, there are now 500 supplied (but don't worry, they are all logically organized into sub-menus and relatively easy to find).
For MediaMonkey 3.0 or higher - just double-click on the RegExpReplace-xx.mmip file; if you are on Vista or Win7 and you got "Product installation error", make sure you have MM3 set to "Run as Administrator"; if you downloaded the installation package with IE7 and it changed its extension to a .zip, you should first change it back to a .mmip.
For MediaMonkey 2.x - rename a .mmip extension to a .zip, extract RegExpReplace.vbs and RegExpReplace.ini files to the MediaMonkey's "Scripts\Auto" folder and restart MM program.
Note: The RegExpReplace.ini file in Auto folder is used only after installation. During its work, the RegExp Find & Replace add-on stores presets into the MediaMonkey.ini file.
If you are upgrading this add-on from some old version it is strongly recommended to follow these steps:
1. make a backup of your own created presets using the Edit > RegExp Export/Import dialog box (pre-v4.4), or Edit > RegExp Find and Replace > Maintain Presets dialog box (v4.4 or higher);
2. uninstall the old version of the add-on and choose Yes when you are asked if you want to remove add-on settings;
3. install the new version of the add-on;
4. import your own created presets using the Edit > RegExp Find and Replace > Maintain Presets dialog box.
In that way you would always have the latest and updated presets. If you don't remove old settings (together with presets), during the installation this add-on would check the preset's names and if they are same as old ones it would skip their installation, even if they are updated.
Using this add-on is very similar to the older versions of the add-on with some additions. The RegExp Find and Replace add-on could be used by the beginners as well as by very advanced users:
1. The beginners could use the add-on by just applying the presets from the menu. You could find 550+ predefined presets for different tasks that could be useful for you without any additional adjustment, e.g. you could clear field, copy conditionally full or part of one field to another, swap the first and the last name of Artist, ... However, with many presets there is a possibility for their fine adjustment in the dialog box that could contain one or more different controls depending of the tags used in the corresponding preset. For example, with the preset "Replace specified string with another one in <Into Field>" you could set 3 parameters: Destination field, String to replace and Replace with.
The presets could be very simple as it is the mentioned one, but also very complex like the "Move right-specified part of <Into Field> between (and including) specified strings to +/- specified word position..." preset.
If you modify some parameter in the adjustment dialog box and confirm execution of the preset with the OK button, that modification will be remembered in the corresponding preset.
2. Somewhat more experienced users could create their own presets to do some frequent data manipulations that are different than those that are included with the add-on. You could use the Edit > RegExp Find and Replace > Preset Settings dialog box to find/replace data in files as you could do in any text editor, but you could also use the same dialog box to create/edit presets. Such presets could be applied from the mentioned dialog box, but they are also directly accessible using the corresponding menus, hotkeys and/or toolbar buttons.
The replacing presets started using menu/hotkey/toolbar will be applied to the files selected in the main filelist or Now playing panel, depending of that which panel is active. The new version of the add-on has also ability to show/select files using presets from menu/hotkey/toolbar, and in that case the presets will be applied on all files that are visible in the filelist or Now playing panel.
You could open the add-on's dialog boxes and apply its presets using the RegExp Find and Replace menu items located in the main Edit menu and popup menus of the main filelist and Now playing panel. You could also get the same menu if you click on the RegExp Tagging Presets toolbar button (light bulb) located on the Search toolbar [MM2-3] or RegExp Find and Replace toolbar [MM4] if the Show the toolbar button for the Presets dropdown list option is turned on in the Options dialog box.
The following items are available in menus:
Preset Settings - use this command if you want to open the RegExp Find and Replace / Preset Settings dialog box that allows finding/replacing metadata in files/database and creating/editing presets; this command is always visible in the Edit menu and popup menus of the filelist/Now playing panel, it is also visible in the RegExp Tagging Presets toolbar menu (light bulb) if the Show the toolbar button for the Find & Replace dialog box option is turned off in the Options dialog box, i.e. when its toolbar button is hidden.
Manage Presets - this command opens the Manage RegExp Presets dialog box that contains a table with all available presets and it allows batch operations on several presets at the same time, e.g. Delete, Export or Import. It also has some another commands that are better used when the presets are displayed in the tabular form, e.g. Find for searching of some specific preset.
Options - when you choose this command you will get opened the RegExp Find and Replace Options dialog box that contains some less important options that affect behavior of the add-on and/or all presets in general.
The next item in menu displays the last applied preset and it is visible only if the Show the toolbar button for the last executed preset from the menu list option is turned on in the Options dialog box.
Unclassified Presets - this sub-menu is visible only if there exists some preset that doesn't have assigned the Menu argument.
Batch Presets - this sub-menu displays all presets that are assigned to some batch group using the Batch option and specifying the wanted batch group with the Menu argument of the preset.
The remaining menu items represent groups of presets that have assigned the Menu argument, e.g. the predefined Basic manipulations sub-menu. Choosing some item from those sub-menus you will start execution of the corresponding preset.
RegExp Find and Replace / Preset Settings
The Preset Settings dialog box allows finding/replacing metadata in files/database and creating/editing presets. This dialog box is resizable, so you could enlarge it, e.g. if you cannot see the content of some control.
The first group of controls in the Preset Settings dialog box is mainly about the user interface of the selected preset. Firstly, we have the Preset label showing the number of the selected preset and total number of presets and next to it we have a combo box which contains a list of all stored presets. You could select some specific preset from that list and after that you could apply it to the selected files or you could modify its settings to suits your needs. That control also allows you to enter a name for the new preset (just keep in mind that all presets should have unique names).
Using the Preset combo box to search for some particular preset that you want to load could be very tedious task since that list could contain 500 or more items. That problem could be avoided using the "..." button that is located on the right side of the Preset combo box. If you click on it, you will get opened the Choose RegExp Preset dialog box that is similar to the Manage RegExp Presets dialog box containing the table with all available presets. You could find the preset in that table that contains the wanted text if you type it in the Find text box. All presets that contain the wanted text will have ticked check boxes on the left side of the table. You could jump to the next or previous preset that contains the specified text using the Next and Prev buttons. With the Match case and Regular expressions check boxes you could further refine the searching results. After you find the wanted preset, you could select it in the table and click the OK button which will load that preset in the Settings dialog box.
Next to the "..." button we have Move up/down buttons which allow us to move selected preset up or down in the list. Then we have 3 buttons for manipulation of presets: New, Rename/Update/Add and Del. The New button resets all controls in the dialog box to their initial (blank) states, which could be used when we want to create a new preset from the scratch. The following button should be used if we want to save the currently selected preset and it has 3 states/captions depending of modifications of the preset's settings:
1. Rename - if you change the preset name only and leave preset parameters unchanged;
2. Update - if you change some parameter (e.g. Description) and leave the preset name unchanged;
3. Add - if you change both the preset name and some parameter.
The next button is Del which could be used when we want to remove the selected preset from the list permanently.
The last button in that row is Tune. If you click on it, you will get opened the Tune parameters of preset dialog box that allows fine adjustment of preset parameters represented with the corresponding tags in the Find what/Replace with strings without messing with their long and complicated strings. The Tune dialog box is similar to the one that you could get when you start some preset using menu/hotkey/toolbar, with only difference that the preset will not be applied when you click on the OK button in the Tune dialog, but it will get modified tags accordingly. However, even if you click on the OK button in the Tune dialog box, you still need to save modification of the preset using the Update/Add button.
The first control in the next row is the Description text box which could be used to enter some information about the selected preset, e.g. to describe its effect with some examples. The description will be also displayed as a hint if you hover a mouse over the corresponding menu item or toolbar button of the preset.
The Batch check box should be ticked on if you want to assign the selected preset to some batch group. All presets that belong to the same batch should have the same Menu name which will appear in the Batch Presets sub-menu. When you choose some batch from that menu, the presets that belong to it will be applied in the same order as they are sorted in the list of presets.
Keep in mind that all presets should have unique names, even presets assigned to some batch group. So, if you want to assign some existing non-batch preset to some batch group and to keep the same preset to the existing menu group, you should rename the new preset assigned to the batch to make its name unique, e.g. you could append the " (Batch)" text to it.
If you start execution of some batch, you will not get the adjustment dialog boxes for any containing preset, even if you have turned on the Show dialog box for adjusting of the preset selected in the menu or toolbar option in the Options dialog box. This means that all presets assigned to batches should have all parameters already set using the corresponding tags in the Find what and Replace with strings, also you should have saved source and/or destination fields (if they are applicable) with the Into and From combo boxes set in the Preset Settings dialog box accordingly.
You could specify in which menu group you want to put the selected preset using the Menu combo box. You could choose some existing menu group or you could create some new one by typing its name. If you leave that box empty, the selected preset will be put in the Unclassified Presets sub-menu. The same combo box is used to specify the name of the batch group if the Batch check box is ticked on. Such batch group will appear in the Batch Presets sub-menu and you could select the corresponding menu item to start execution of that batch of presets.
If you want to apply some preset without searching for it in the menu, you could assign the toolbar button to it, so you could just click on that button to start its execution. The Toolbar check box should be ticked on if you want to get the toolbar button for the selected preset displayed on the toolbar (Search [MM2-3] or RegExp Find and Replace [MM4]). By the way, you need to click on the Update button to confirm any modification of the preset's settings, even if you just toggle the state of the Toolbar check box.
The toolbar buttons of presets could display a textual caption with the name of preset or an icon. Since the preset names are very long, their captions could be trimmed to the specified number of characters using the Trim toolbar button's caption (maximal number of characters) option in the Options dialog box.
If you want to pack even more buttons on the toolbar, you could use the icons instead of the textual captions. You could assign the icon to the selected preset choosing it from the Icon dropdown list and that icon will be displayed in the presets menu and on the corresponding toolbar button. The icon could be loaded from an external .ico file or you could choose some internal MM's one represented with its number (the built-in icons for the Glided skin with their numbers could be downloaded from here). The external .ico file could be specified after click on the same Icon combo box when the mouse pointer looks like a pointing hand. If you want to remove icon from the preset, i.e. to get the textual caption back on the toolbar button, you should choose the first (empty) item from the Icon dropdown list.
If you prefer keyboard over mouse, you could start execution of preset by the press on a hotkey. To be able to do that you need to assign the hotkey to the selected preset using the Hotkey text box, e.g. you could specify Shift+Ctrl+T.
The following controls in the Preset Settings dialog box describe how the selected preset should perform. The first control in the next (finding) group is the Find what combo box/text box which is used to specify the string that we want to search for. The same control is used to specify the string that will be replaced in the destination field if the inverted mode is turned off using the Invert check box (more about it latter). The Find what combo box has a dropdown list with the history of the last 5 applied search strings. The "^/_" button that is on the left side of the Find what control could be used to toggle size of the Find what control, if you want it larger (multi-line text box) or smaller (combo box).
The button and dropdown control that are on the right side of the Find what combo box could be used to insert some text in that control, depending of the other preset settings (if Regular expression (F.) is ticked on, that combo box will contain Entire, Empty, Filled, Begin and End items, but if the VBScript (F.) is ticked on, it will contain Field, <From>, <Into>, <Str.> and < Num.> items). Those controls are not enabled if both Regular expression (F.) and VBScript (F.) are ticked off. With the click on the button you would insert the corresponding text into the Find what string, e.g. with the Entire item you will get "^.*" which is the Regex replacement for the full content of the field, not matter what the selected field contains.
The next combo box has two meanings, depending of the inverted mode set by the Invert check box: if the inverted mode is turned off, that combo box would have displayed Into and with it we could specify the destination field that will be searched and modified; if the inverted mode is turned on, that combo box would have displayed From and with it we could specify the source field only for searching.
The items in the Into/From dropdown lists represents the MediaMonkey fields that are available for searching/modification with this add-on and many of them have corresponding tags that are stored inside media files.
In general, the presets could be applied only on one destination field at once. However, the first item in the Into list (All Text Fields) is specific and it allows modification of several textual fields at once using the same replacement. You could specify which text fields you want to modify using settings in the Search sheet of the Options dialog box [MM3.1+], but please be careful with that option, especially with the specified Path field!
If you want to manipulate several unrelated fields at once, you could try to do that with several presets applied in sequence, manually or putting them in a batch. It is also possible to write a single preset that could modify two or more fields at once, but you need to have a good VBScript knowledge to do that (please take a look at the "Swap <From Field> and <Into Field>" preset as an example).
The first combo box in the next row has four items that determines the information displayed in the following info box that is below Find what control:
Old <Into> displays the old content of the destination field specified with the Into combo box, i.e. the content before the applied replacement (the Original info in old versions of the add-on);
Old <From> displays the content of the source field specified with the From combo box when it is applicable (when the corresponding Regular expression or VBScript check boxes are ticked on), it also displays the old content of the source field before the applied replacement with presets that modify both source and destination field, e.g. "Swap <From Field> and <Into Field>" (the Replacement info in old versions of the add-on);
New <Into> displays what would be the new content of the destination field specified with the Into combo box, i.e. the content after the applied replacement (the Result info in old versions of the add-on);
New <From> displays what would be the new content of the source field specified with the From combo box, i.e. the content after the applied replacement with presets that modify both source and destination field (it displays the old content as Old <From> with the presets that modify only the destination field which are mostly represented).
The Regular expression (F.) check box should be ticked on if we want to use regular expressions in the Find what string. The VBScript (F.) check box should be ticked on if we want to use VBScript conditions in the Find what string that determine if/when the replacement should occur and it is enabled only in the inverted mode set by the Invert check box.
The Find whole words only check box should be ticked on if we want to search only for whole words (otherwise any field text that contains the specified Find what string would be matched). It could be used only when the Regular expression (F.) is ticked off since the regular expressions have their own way to find only whole words.
The previous three check boxes determine behavior of the string specified with the Find what control, while the next Match case check box determines behavior of both Find what and Replace with strings. It should be ticked on if you want to search and/or replace only parts of the string with the exactly same case, e.g. if you want to find "i" but not "I".
The first control in the next (replacement) group is the Replace with combo box/text box which could be used for specifying a string that we want to use for the replacement. Similarly to the Find what combo box, that control has a dropdown list with the history of the last 5 applied replacement strings, and there is also the "^/_" button on its left side that could be used to toggle the size of the Replace with control. The button and dropdown control that are next to the right side of the Replace with combo box have the same purpose as the similar controls on the right side of the Find what combo box, i.e. they could be used to insert some text in the Replace with string, depending of the Regular expression (R.) and VBScript (R.) settings.
The next combo box has two meanings, similarly to the combo box that is on the far right side of the Find what combo box, depending of the inverted mode set by the Invert check box. If the inverted mode is turned off, that combo box would have displayed From and it is enabled only if the Regular expression (R.) or VBScript (R.) are ticked on. If the Regular expression (R.) is ticked on then you could use the From list to specify the source field for the replacement. However, if the VBScript (R.) is ticked on then you could use the From list to select some field which you want to paste into the Replace with string using the previous button and dropdown list, or you could choose the field which would be substituted instead of the <From Field> tag that you could have specified inside of the Replace with string (please read the Adjustment section regarding to the <From Field> tag). If the inverted mode is turned on, the mentioned combo box would have displayed Into and with it we could specify the destination field that will be modified.
The leftmost combo box in the next row has four items that determines the information displayed in the following info box that is below Replace with control and they have the same behavior as the items in the similar combo box below the Find what control: Old <Into> (Original), Old <From> (Replacement), New <Into> (Result), New <From>.
You should tick on the Regular expression (R.) or VBScript (R.) check boxes if you want to use the corresponding expressions in the Replace with string.
The Invert combo box should be ticked on for the so-called inverted mode when you could find something in one (From) field and use matched string to replace data in another (Into) field (until now it was possible to replace data only in the same field that is also used to find data). This option is experimental and maybe I will change it in the future.
The Action combo box determines what will happen if you start some preset by menu/toolbar/hotkey. With the previous versions of the program that action was always the same as the Replace All button in the Preset Settings dialog box applied to the files selected in the main filelist. However, with this option you could set some another action:
Replace in all selected files - the same as before;
Replace in currently playing - if you want to apply the replacement to the currently playing file;
Keep files with matched tags - the same effect as when using the Keep matched button on the bottom of the Preset Settings dialog box;
Select files w/ matched tags - the same as Select matched;
Keep files w/ unmatched tags - the same as Keep unmatched;
Select files w/ unmatched tags - the same as Select unmatched;
Keep files w/ replaceable tags - the same as Keep replaceable;
Select files w/ replaceable tags - the same as Select replaceable;
Keep files w/ irreplaceable tags - the same as Keep irreplaceable;
Select files w/ irreplaceable tags - the same as Select irreplaceable.
The effect of the corresponding buttons to those actions will be described latter.
The table on the bottom of the Preset Settings dialog box shows 25 files surrounding the current file, with displayed the old and new content of the chosen destination field in these files. The number of showed files in the table could be adjusted in the Options dialog box using the Maximal number of table rows in the Find & Replace dialog box option. Each row in the table has a check box in the first column, if that check box is ticked on the corresponding file will be modified when using the Replace or Replace All buton. With the check box on the left side of the table header you could tick on/off all files in the table.
If you click on the leftmost "?" button from the bottom row of controls you would get the short reference for the Regular expressions and custom VBScript functions used in this add-on which will be displayed instead of the mentioned table with files - if you click on the same button again you would get back displayed that table again.
The number of the current file (on which you could apply the Replace option) is displayed in the text box in the left-bottom corner of the dialog box and the field's content of that file is displayed in the previously mentioned info boxes that are below the Find what and Replace with combo boxes. The first up/down buttons next to that text box serve to change the current file in steps by one, while the following up/down buttons change it in 25 steps, i.e. one page up or down in the table.
The next button (which looks more like a text box) displays the total number of files that are selected/visible in the main filelists. If you click on that button you would toggle between selected and visible files. That means that you could apply the preset on all visible files without selecting them all in the filelist.
The Find Next/Find Prev button could be used to locate the next/previous file that matches criteria specified with the controls in the finding group and that file would become the current one. The searching direction could be set with the arrow button that is next to the mentioned button.
The Replace button could be used to apply the selected preset to the current file, after that the current file will become the next/previous file that matches the specified criteria. The Replace All button could be used to apply the selected preset to all files that are selected/visible in the main filelist (be very careful when doing that).
The last button at the bottom row before the Close button has several possible actions which could be chosen from the list that you could get by the click on the button with the down arrow: Keep matched, Select matched, Keep unmatched, Select unmatched, Keep replaceable, Select replaceable, Keep irreplaceable and Select irreplaceable. None of those options modify fields/tags in files, but they could show which files have fields that could/couldn't be found/modified using the selected preset.
If you choose some of "Keep ..." options you would get removed all files from the main filelist that don't satisfy the selected option. For example, if you choose Keep replaceable option, you will get displayed only files that could be actually modified when using the selected preset. Similarly, if you choose some "Select ..." option you would get selected files in the main filelist that satisfy the selected option without removing other files.
Manage RegExp Presets
The Manage RegExp Presets dialog box is similar to the mentioned Choose RegExp Preset dialog box with the same Find options for searching presets, but it also contains several additional controls that allow some operations on the preset(s) selected/checked in the table. There are two radio buttons on the top of the dialog box: MediaMonkey.ini and File. If you select the MediaMonkey.ini option, you will get displayed all RegExp presets that are stored in the main MediaMonkey INI file, i.e. the presets that are displayed in the RegExp menus. You will be able to export such presets, as well as to add/edit, delete or move them.
If you choose the File option, you could get displayed presets from some external INI file which could contain e.g. your previously exported presets. You could type its path in the following text box or you click on the "..." button and find that INI file in the new Open File dialog box. You will be able to import such presets, as well as to delete or move them (if the loaded INI file is not marked to open as read-only).
The presets and their groups could be sorted if you click on the table header that contains displayed the information about loaded presets. This operation is not reversible, so be careful using this option and make a backup of your presets first. On the right side of the table header is located the Word wrap check box that could be used to toggle the type of display of presets in the table.
If you right-click on the table you would get a pop-up menu with some options that already exist in the dialog box like Word wrap and Match case, but it also contains options that are not available otherwise and they could be used to choose the type of the sorting of presets. There are 4 different types of sorting:
Group all presets by menu - is the same sorting which you will get if you left-click the header of the table - the menu groups and presets inside them will keep their order in the menus, but the order of presets in the preset list will be seamless inside their groups following the same order as it is in the menus (this could be handy to keep presets sequential, because when creating a new preset it is placed on the end of the list if you don't specify Menu, and changing its Menu latter do not change its position in the list);
Sort all presets by name in menu - the menu groups will keep their order in the menus, but presets will be sorted alphabetically inside each menu group;
Sort all presets by menu and name - the menu groups will be sorted alphabetically and the presets will be sorted alphabetically inside each menu group;
Sort all presets by name only - all presets will be sorted alphabetically without taking in account their menu groups.
If this description about types of sorting is not clear, the best way to see the result of these options is to experiment with them, but since the sorting is irreversible you should make the backup of the presets first, to be able to revert their order if you change your mind.
Before you choose some option for alphabetical sorting of presets, you should know that the order of the presets in the list of presets is important for the execution of batches. The batches execute their containing presets in the same order as they are placed in the list. So, if you sort the list of presets alphabetically, you could get an unwanted order of presets inside batches!
Selecting/checking of the preset(s) on which you want to implement some operation could be done in two ways: you could use the check boxes located on the left side of the table or you could select the wanted preset directly in the table. Using the second way you could select only one preset at the time and that way has the precedence over those two ways of selecting, i.e. even if you have some or all presets checked on in the table, if you choose some operation as Delete it will be applied only on the selected preset, but not on the checked presets. If you want to deselect the currently selected preset, e.g. if you want to do some operation against the checked presets, then you should click on the already selected preset again.
The Move operation could be done only on a single preset at the time that is selected in the table. Using the Up and Down buttons you could move the selected preset in the appropriate direction in the list of presets. Those two buttons have the auto-repeat possibility, i.e. it is enough to click on some of them and the selected preset will continue to move in the table until you release that button.
The next button in the Manage RegExp Presets dialog box has two possible captions: Add and Edit. It will have the Add caption if you don't have any preset selected in the table; if you click on it, you would get opened the Add RegExp Preset dialog box that is the same to the Edit RegExp Preset dialog box, but it contains all controls set to their initial (blank) state and it allows adding of some new preset to the list of presets.
If you select some preset in the table of the Manage RegExp Presets dialog box, the mentioned button will have the Edit caption; if you click on it, you would get opened the Edit RegExp Preset dialog box; in this case all controls in the Edit RegExp Preset dialog box (that is very similar to the Preset Settings dialog box) will be set accordingly to the selected preset, which means that you could modify the existing presets from the Manage RegExp Presets dialog box. You could also open the Edit RegExp Preset dialog box to edit some preset if you click its serial number displayed in the "#" column of the table for that preset.
You could use the Delete button if you want to remove the selected/checked preset(s) permanently, so be careful using it. The enabled state of the next two buttons, Export and Import, depends of the selected option on the top of the dialog box: as it is already explained, you could export the selected/checked presets from the MediaMonkey.ini file or you could import the selected/checked presets from the specified external INI file.
The RegExp Find and Replace Options dialog box contains some less important options that affect behavior of the add-on and/or all presets in general. You could open this dialog box:
1) if you choose any of the mentioned Options commands in the RegExp Find and Replace sub-menus of the File menu, the RegExp Tagging Presets toolbar menu (light bulb) and the context menus of the main filelist and Now Playing panel, or
2) if you select RegExp Find and Replace add-on in the Tools > Extensions dialog box and click on the Options button, or
The same options could be found on the General > RegExp Find and Replace page in the Tools > Options dialog box.
Confirm update/delete of the preset selected in the Find & Replace dialog box: if you turn off this option you will not be asked if you want to update or delete preset in the Preset Settings dialog box.
Confirm execution of the preset selected in the menu or toolbar: if you turn off this option you will not be asked if you want to apply the preset that you have started by toolbar/hotkey/menu.
Show dialog box for adjusting of the preset selected in the menu or toolbar: if you turn off this option you will not get displayed the adjustment dialog box for the preset that you have started by toolbar/hotkey/menu.
Delete emptied folders when moving files as a result of the Path modification: you should turn on this option if you want to delete folders that are left empty after moving files as a result of the applied presets that modify the Path field.
Maximal number of table rows in the Find & Replace dialog box: you could set the maximum number of rows in the table of files in the Preset Settings dialog box using this option.
Trim toolbar button's caption (maximal number of characters): you could set the maximum number of characters that should be displayed on the toolbar buttons of presets.
Show the toolbar button for the Find & Replace dialog box: if you turn off this option the toolbar button that opens the Preset Settings dialog box will not be displayed.
Show the toolbar button for the Presets dropdown list: if you turn off this option the toolbar button that shows RegExp Find and Replace sub-menu in the toolbar will not be displayed.
Show the toolbar button for the last executed preset from the menu list: if you turn off this option the toolbar button that start execution of the last preset will not be displayed.
Keep the toolbar button for the last executed preset after restart: you should turn on this option if you want to get displayed the toolbar button that start execution of the last preset after restart of the program; this option is enabled when the previous option is turned on.
Show toolbar buttons for presets with enabled button in Find & Replace dialog box: if you turn off this option you will not get displayed the toolbar buttons for any preset, even if some of them have the Toolbar button options turned on.
Modeless Find & Replace dialog box (allowed access to other parts of the program): you could turn this option on if you want to get modeless Preset Settings dialog box which allows access to the other parts of the program; when that option is turned off, the mentioned dialog box will be modal and you need to close it if you want to use the other parts of the program.
Display of tracks in Find & Replace dialog box synchronized with main window: if you turn off this option the table of files in the Preset Settings dialog box will not change when you change the selection of files in the main filelist; this option is enabled when the previous option is turned on (you could change selection of files in the main filelist only if the Preset Settings dialog box is modeless).
This add-on has a possibility to display a resizable dialog box for adjustment of preset whenever you start its execution using menu/toolbar/hotkey if it is modified adequately. Usage of those dialog boxes is much simpler for use than the Preset Settings dialog box which has many controls that are confusing for beginners. For example, you could choose Edit > RegExp Find and Replace > Field Manipulations > Copy <From Field> to <Into Field>... and you would get the dialog box with just two dropdown lists for choosing the source and the destination fields. The number of displayed controls depends of the adjustment tags that are used in the preset.
If you specify <Into Field> tag in the name of some preset, you would get the adjustment dialog box with one dropdown list from which you could choose the destination field after you start the execution of preset. Similarly, if you specify <From Field> tag in the name of preset, you would get the dialog box with the dropdown list for choosing the source field. Of course, if you specify both <Into Field> and <From Field> in the name of the preset, you would get the dialog box with both dropdown lists. For example, the included preset "Copy <From Field> to <Into Field>..." displays both lists.
If you specify custom parameters inside of the Find what and Replace with strings using the <String Caption="xxx" Value="yyy"> tag, you would get the preset dialog box with the text box in which you could write some string and that string would be entered into same place in the Find what/Replace with string where you have put that <String> tag. Also, if you specify the <Number Caption="xxx" Value="yyy"> tag, you would get the preset dialog box with the spin/slider controls for choosing the numeric value. For example, if you write <Number Caption="Increment" Value="10"> instead of 10 in some preset, you would get the dialog box which allows adjusting of that numeric value.
The Value argument is mandatory for those two tags. The Caption argument allows you to specify descriptive text which would be displayed next to the control; it is not necessary to be specified, but it would be better for understanding of such preset if you use it. The <Number> tag additionally allows to specify two optional arguments: MinValue and MaxValue, the first one is for specifying the minimum value which could be entered with the spinedit control, and the second one is for the maximum value. If you omit those arguments, the default values are 0 and 100 correspondingly.
You could specify as many <String> and <Number> tags in the Find what and Replace with string as you want, and you would get the adequate number of controls within the preset dialog box. Of course, those controls would be displayed together with the source and the destination dropdown lists if you have <From Field> and/or <Into Field> in the name of the same preset. For example, the included preset "Replace specified string with another one in <Into Field>..." has the adjustment dialog box with the destination dropdown list and two text box controls - the first one is for specifying the string which would be replaced and the another one is for specifying the replacement string.
The new version of the add-on also supports the <If>, <Else>, <End If> and <ID> tags. The <If> <Else> <End If> construction of tags allows conditional execution of some parts of the Find what/Replace with strings.
The <If> tag has three different forms:
1) The standard one is when you specify the Caption and Value arguments. It could have have 0 and 1 as a Value argument, or "False" and "True".
If the Value is 1, the text between <If> and <End If> tags will be included in the Find what/Replace with strings; otherwise, if the Value is 0, the text will be omitted.
If the Value is 1 and if <Else> tag is specified between <If> and <End If> tags, then only the text between <If> and <Else> tags will be included in the Find what/Replace with strings, but the text between <Else> and <End If> tags will be omitted; if the Value is 0, the text between <If> and <Else> tags will be omitted and the text between <Else> and <End If> tags will be included.
If you use the <Else> tag without the Caption argument, the whole <If> <Else> <End If> construction will be displayed as a check box in the Adjust dialog box. However, if you specify the Caption argument in the <Else> tag, the same construction will be displayed as a group containing two radio buttons; the first button will display the Caption specified in the <If> tag, and the second one will display the Caption specified in the <Else> tag.
The <If> tag in the first form could have specified ID argument as well.
2) The second form of the <If> tag is when you specify only ID argument. In this case it could be treated as if it has a Value as another <If> tag with the same ID argument that has specified the Value argument. The second form (with only ID argument) is not displayed in the Adjust dialog box as any control, but its nested controls/tags will be displayed next to the controls/tags contained in the corresponding <If> tag that has specified the Value argument.
3) The third form is when you specify the Value argument without the Caption argument. This form will not be displayed in the Adjust dialog box either. It is mostly useful if you want to specify some VBscript expression in the Value argument, e.g. <If Value="Len(""<ID:2>"") > 0"> ... <End If>, which will have included/excluded text in the Find what/Replace with strings depending of the result of that expression.
The <End If> tags should not have any specified argument.
The text between <If> and <End If> tags could contain another tags which would have corresponding controls enabled if the Value of <If> tag is 1. The text between <If> and <End If> tags could contain even another <If> / <End If> blocks, which means that they could be nested without any limit on depth.
The <ID> tag allows the same text to be used several times in the Find what/Replace with string without its repeating and should have only one argument, e.g. <ID=1>. That tag will be replaced in the string during run-time with the Value argument of some another <String>/<Number>/<If> tag that has the same ID argument. The ID argument could be also used to specify order of controls in the dialog box.
Adding any of those mentioned tags to the presets is optional. The presets with those tags are longer and somewhat harder to write, but you could do that just once and after that their adjustment using the adjustment dialog box will be child's play. Of course, many of the predefined presets are already written with such tags, so you could use them out of the box.
The adjustment dialog boxes that you get when you choose presets by menu/toolbar/hotkey are similar to the Tune dialog box that could be opened from the Preset Settings dialog box, with the difference that the preset will be actually applied when you click on the OK button in them.
The adjustment dialog boxes have also the Don't show this dialog anymore check box on the bottom. If you have ticked on that check box, after you confirm the execution of preset the subsequent presets started by menu/toolbar/hotkey will be applied without displaying of the adjustment dialog box. If you want to have the adjustment dialog box displayed again, you should turn on the Show dialog box for adjusting of the preset selected in the menu or toolbar option in the Options dialog box.
This add-on is a false positive reported as a worm by F-Secure. The author of F-Secure promised me that will update its database and put the add-on on the white-list, but still didn't. If you go to the www.virustotal.com/en/ site, you will see that it is safe tested by 54 popular anti-virus engines; the only one reporting a worm in it is F-Secure. By the way, the F-Secure was constantly having the largest number of false positives in last few years according to the Real-World Protection Test by AV-Comparatives.
If you are interested about my other add-ons for MediaMonkey, you could visit the following page.