by ZvezdanD » Sat Feb 21, 2015 4:43 am
Of course it is possible to write the script which would select files with some specific pattern. The Invert Selection script is not intended for such purpose and I don't have any plan to extend it in that direction.
The RegExp Find & Replace script could be used to select files with the mentioned patterns, but its use for such task has some drawbacks. First of all, you should select all files on which you want to implement the specific selection pattern before you open the RegExp dialog box. Secondly, you cannot use the hotkey or menu/toolbar command to execute such selection pattern, but you could do that only from the RegExp dialog box using its Select to replace option from the combo box located on the left of the Close button.
Of course, before you chose the mentioned option you should write the appropriate preset which will implement the wanted selection pattern. For example, with the next preset settings you would get selection of every other track:
Find what: ^.*
Regular expression 1: checked
Replace with: IIf(lSongIndex \ 2 = lSongIndex / 2, "$&", "@#$ZvezdanD")
VBScript expression: checked
The field selected in the Into combo box is not important because you don't want to do any actual replacement, but you should be maximally careful to not click the Replace or Replace All buttons with such preset, but you should choose the mentioned Select to replace option instead.
The new, unpublished version has implemented the additional options which eliminate some of the mentioned drawbacks:
- you could choose which operation will be executed with some preset initiated by its hotkey or menu/toolbar command (until now it was only Replace, but it is now possible to choose the other commands from the mentioned combo box as well, i.e. Keep Matched, Select Matched, Select to Replace...);
- you could select VBScript expression for the searching field, i.e. field on which is applied Find what string (until now it was possible to select VBScript expression only on the replacing string);
- you could switch roles for Into and From combo boxes which allows to search for one field and replace value in some another field (the current version allows only to replace value of the same field that is searching).
So, with the new version you could write the preset which could be used only for selecting files, but not for their replacements. However, even with that version the first drawback stays, i.e. you should first select all files on which you want to implement the wanted selection pattern.
Of course it is possible to write the script which would select files with some specific pattern. The Invert Selection script is not intended for such purpose and I don't have any plan to extend it in that direction.
The RegExp Find & Replace script could be used to select files with the mentioned patterns, but its use for such task has some drawbacks. First of all, you should select all files on which you want to implement the specific selection pattern before you open the RegExp dialog box. Secondly, you cannot use the hotkey or menu/toolbar command to execute such selection pattern, but you could do that only from the RegExp dialog box using its [i]Select to replace[/i] option from the combo box located on the left of the Close button.
Of course, before you chose the mentioned option you should write the appropriate preset which will implement the wanted selection pattern. For example, with the next preset settings you would get selection of every other track:
Find what: ^.*
Regular expression 1: checked
Replace with: IIf(lSongIndex \ 2 = lSongIndex / 2, "$&", "@#$ZvezdanD")
VBScript expression: checked
The field selected in the [i]Into[/i] combo box is not important because you don't want to do any actual replacement, but you should be maximally careful to not click the [i]Replace[/i] or [i]Replace All[/i] buttons with such preset, but you should choose the mentioned [i]Select to replace[/i] option instead.
The new, unpublished version has implemented the additional options which eliminate some of the mentioned drawbacks:
- you could choose which operation will be executed with some preset initiated by its hotkey or menu/toolbar command (until now it was only Replace, but it is now possible to choose the other commands from the mentioned combo box as well, i.e. Keep Matched, Select Matched, Select to Replace...);
- you could select VBScript expression for the searching field, i.e. field on which is applied [i]Find what[/i] string (until now it was possible to select VBScript expression only on the replacing string);
- you could switch roles for [i]Into[/i] and [i]From[/i] combo boxes which allows to search for one field and replace value in some another field (the current version allows only to replace value of the same field that is searching).
So, with the new version you could write the preset which could be used only for selecting files, but not for their replacements. However, even with that version the first drawback stays, i.e. you should first select all files on which you want to implement the wanted selection pattern.