RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [MM2+]

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [MM2+]

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [MM2+]

by ZvezdanD » Wed May 16, 2018 12:37 pm

Ludek wrote:
Wed May 16, 2018 8:15 am
whether you are doing something special when adding the items in 'OnStartup' proc or whether you are adding them the same way as during install (when it takes just second)?
No, I am not doing anything special in OnStartup procedure when adding menu items. Yes, I am adding them the same way as during install. Actually, I am using the same OnStartup procedure during install to install the presets and hence to create the related menu items.
Ludek wrote:
Wed May 16, 2018 8:15 am
I am sure (and the others users too), it is not related to many menu items, but to many COM objects initializations/calls (OLE automation)
Yes, but I need one COM object's call per menu item. The script has one object containing a collection with menu items added to it during OnStartup, to be able to remove them from Uninstall.vbs if user decide to uninstall the script and maybe because of other reasons that I cannot remember right now. Here is the important line working in a loop with the number of presets as a counter:

Code: Select all

        SDB.Objects(sPrstColl).Add sPrstItem, SDB.UI.AddMenuItem _
                (SDB.Objects(sGroupColl).Item(sMenuGrp), 0, 0)
I think it is really strange if Windows Defender is so sensitive to the number of COM objects' calls during startup of some application and I suggest that you report that to Microsoft.

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [MM2+]

by Ludek » Wed May 16, 2018 8:15 am

ZvezdanD wrote:
Tue May 15, 2018 3:30 pm
I don't think that enabling creation of the menu items sometime later after startup could resolve such problem.
I am playing with this a bit and interesting is that during the install the script asks: "Would you like to add 253 new sample presets..." and if I click Yes then all the menu items are added in one second! Like previously or with disabled Windows Defenrer's real time protection, but during startup it takes 50 seconds to add all the menu items. I also tried to move the startup stripts initialization to post startup action and the issue persists and it still takes 50 seconds even if it is run several seconds after MM startup. Your script is obfluscated so I cannot see whether you are doing something special when adding the items in 'OnStartup' proc or whether you are adding them the same way as during install (when it takes just second)? I would like to understand the difference.

FYI: So far I resolved the long startup time this way in 1867 : https://www.ventismedia.com/mantis/view ... 820#c50309

BTW: I guess you can also easily replicate the issue once you install all the April's Windows 10 updates (real time protection is enabled by default in Windows Defender).
ZvezdanD wrote:
Tue May 15, 2018 3:30 pm
Are you sure that Windows Defender is doing this because of the number of menu items? That could mean that it is slowing down every program which have too many menu items and maybe you should report that problem to Microsoft.
I am sure (and the others users too), it is not related to many menu items, but to many COM objects initializations/calls (OLE automation), when adding the item (in MM scripting) then new COM object is created and the Defender's real time protection seems to check the COM object creations somehow (via oleaut32.dll)
ZvezdanD wrote:
Tue May 15, 2018 3:30 pm
By the way, you should try the latest version of the script (4.4.8) from its Web page. Maybe it will behave differently.
I am testing 4.4.8 and the issue persists.

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [MM2+]

by ZvezdanD » Tue May 15, 2018 3:30 pm

Ludek wrote:
Tue May 15, 2018 12:34 pm
Do you think that it makes sense to modify "RegExp Find & Replace 4.3" script to not create all the menu items on startup, but either create them on demand (or not create them at all)?
I don't think that enabling creation of the menu items sometime later after startup could resolve such problem. Those objects that you are mentioning in Mantis should be created to be able to have menu items, no matter when the script create them. Disabling creation of those menu items is not solution for this script since the main use of it is because of the related presets. Anyway, the users have a possibility to remove unwanted presets/menu items from the menu if they want to speed up the startup.

Besides, Magic Nodes also create many menu items during startup, but they are hidden and added only to allow Shortcuts for jump to the specific node in the tree.

Are you sure that Windows Defender is doing this because of the number of menu items? That could mean that it is slowing down every program which have too many menu items and maybe you should report that problem to Microsoft.

By the way, you should try the latest version of the script (4.4.8) from its Web page. Maybe it will behave differently.

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [MM2+]

by Ludek » Tue May 15, 2018 12:34 pm

Hi Zvezdan,
we've just found that the last Windows Defender update with combination of this script causes MM startup issues, details at:
https://www.ventismedia.com/mantis/view.php?id=14820

Do you think that it makes sense to modify "RegExp Find & Replace 4.3" script to not create all the menu items on startup, but either create them on demand (or not create them at all)?

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

by ZvezdanD » Wed Mar 21, 2018 9:24 am

Preset: Assign <Into Field> if it is empty with value from the previous non-empty tagged track in list...
Description: Destination field of track1: "ZD", track2: empty, track3: empty, track4: "XY", track5: empty -> track1: "ZD", track2: "ZD", track3: "ZD", track4: "XY", track5: "XY"
From what: ^.*
RegExp (F.): checked
Replace with: Eval(IIf(lSongIndex = 1, "SetVar(0, <Into Field>)", "Eval(IIf(Len(<Into Field>) = 0, ""GetVar(0)"", ""SetVar(0, <Into Field>)""))"))
VBScript (R.): checked

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

by ZvezdanD » Tue Mar 20, 2018 1:36 pm

beg wrote:If I understand your suggestion right, then I'd have to change the "specified string" in the settings each time in order to be able to copy them in the fields?
Yes, you need to enter the "specified string" manually.

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

by beg » Tue Mar 20, 2018 1:15 pm

sorry, the field I ment is called Lyricist(s) which we use for the author. But that's not really the issue I think.

If I understand your suggestion right, then I'd have to change the "specified string" in the settings each time in order to be able to copy them in the fields? I am afraid that that would be more complicated than using the manual edit properties check box solution. : (

Thx for your fast replies as ever, but maybe this time your script can't help us out.. : (

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

by ZvezdanD » Tue Mar 20, 2018 11:21 am

beg wrote:I want to select those three and have the data from Composer and Author copied into all other tracks not having a composer and author set.
First of all, the Composer field is the same as the Author field since MediaMonkey uses a single field for that in the Songs table. Secondly, as I said, this add-on cannot copy the field's content of one file to the other files directly.

However, you could manually copy Composer from the file that has that field already entered, then select all files with that field empty and use the preset "Assign specified string to <Into Field>...". If you want to be sure to not select and overwrite the files that already have entered the Composer field, you could modify the mentioned preset by replacing the Find what string with the "^$" or simply choose Empty from the combo box on the left side of the Into combo box.

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

by beg » Tue Mar 20, 2018 10:45 am

Thx for your fast reply. this get's a bit tricky for me. Not sure if this preset works as it says that tracks should have the same album title, but I'd need it to work across various ablums.

I'll try to explain my use case differently:

Title xy - Album 1 - Artist 1 - Composer: XY - Author: XY
Title xy - Album 2 - Artist 2 - Composer: empty - Author: empty
Title xy - Album 3 - Artist 3 - Composer: empty - Author: empty

I want to select those three and have the data from Composer and Author copied into all other tracks not having a composer and author set.
(Actually I also need this to work for the columns "Original Artist" and "Original Title" which I am using for disc and matriz numbers, but hopefully this would work the same?)

Anyway I it need to work across various albums.

It is basically the function the check boxes next to the fields in the edit properties window is providing - just without getting into properties, choosing the correct tab, checking the corresponding checkboxes and apply the settings. I am looking for a shortcut to do this.

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

by ZvezdanD » Tue Mar 20, 2018 10:26 am

beg wrote:I want to select those recordings and use the hotkey bound to RegExp function/batch which then copies the composer and the author from the recording having the information into all corresponding fields of the selected fields (being empty).

I know that I can copy field to field, but I don't know how to have one prefilled field copied into all the other fields being empty.
I am not sure what you want, I think you have some typos in your post (fields instead of files). Do you want to copy the Composer field from one file to the other files? It is not so easy since this add-on is based on individual files, i.e. the content of one file cannot be used in other files directly. Maybe you could try with "Assign Artist if it is empty with value assigned to most tracks from same album" from the "Based on related files" menu, then choose "Composer" from the Into combo box and replace all "Artist" occurrences with "Author" inside the Replace with string.

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

by beg » Tue Mar 20, 2018 9:49 am

another question regarding this swiss army knife addon:

I am looking for a way to assign a hotkey doing the following example:

One track has a composer and an author correctly tagged.
Various other versions of the same recording do not have any information for composer and author.

I want to select those recordings and use the hotkey bound to RegExp function/batch which then copies the composer and the author from the recording having the information into all corresponding fields of the selected fields (being empty).

I know that I can copy field to field, but I don't know how to have one prefilled field copied into all the other fields being empty. It's what I do manually at the moment marking all tracks and set the check-box to use the info of one field to be used for all. But since I have to do this many thousand times, I'd prefer to have that function on a shortcut. Is it possible using this script?

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

by beg » Sat Mar 03, 2018 10:29 am

thank you, I managed with two of those presets - the hint for the "copy leftmost part of.." was very helpfull! I combined it afterwards with "remove leftmost part of.."

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

by ZvezdanD » Sat Mar 03, 2018 8:41 am

beg wrote:I don't know how to split it.
There are several presets from the "Separated field parts" menu that you could try using ", " as separator, e.g. "Copy the begin of <From Field> before leftmost specified string to <Into Field>...".

You could also use presets from the "Partial manipulations" menu. For example, "Copy leftmost part of <From Field> between specified strings to <Into Field>..." with Opening string = "Matriz " and Closing string = ", ".

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

by beg » Sat Mar 03, 2018 7:21 am

I'd have another tricky one..
I need to manipulate about 2000 tracks splitting and moving information from one colume in two others.
The data in one column is like this:

Matriz E 2922, cat. 18246
Matriz 1027-1, cat. 18061
Matriz 1028, cat. 18061-1
Matriz 1176, cat. 18036, segunda versión
Matriz 42, cat. 18009
Matriz E 3121, cal. -

I need to move the value between "Matriz" and "," in another column.
I need to move the value after "cat."in another column
Anything behind "cat. xx," remains.

It can be a several steps process. And I know how to get rid of the additional stuff like "Matriz" and so on, but I don't know how to split it.

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

by moviemonkey » Thu Feb 22, 2018 10:51 am

preset Abc [Xyz -> Abc does not work

(.+)\[([^\]]*)$ just remove [

so, Abc [Xyz -> AbcXyz

Can you make this work properly and work with () also?

like, Abc (Xyz -> Abc

And I like another preset that makes Abc (Xyz -> Abc (Xyz)

I tried change this alone, but couldn't

Thank you

Top