Syntax error on removal of certain characters and text

Hello there, I'm trying to remove certain words and characters from MP3 files but I seem to have typed something wrong?

Can someone please tell me what the problem is?

Thanks

Could you copy and paste your expression here to the forum in plain text? I am not too eager to type in all myself.
To show code as it is without the forum formatter hitting, enclose the code in the grave accent.

Of course, thanks.

[#0]
T=5
! Remove Text (Album, Digital Album, EP, LP and Single) DIRECTORY=
F=_DIRECTORY
1=$replace(%_directory%, '('album')',, '('digital album')',, '('ep')',, '('lp')',, '('single')',)

[#1]
T=5
! Remove Text (Acoustic, Album, Digital Album, EP, LP and Single) from FILENAME=
F=_FILENAME
1=$replace(%_filename%, '(acoustic')',, ''album')',, '('digital album')',, '('ep')',, '('lp')',, '('single')',)

[#2]
T=5
! Remove Text (Album, Digital Album, EP, LP and Single) from ALBUM=
F=_ALBUM
1=$replace(%_album%, '('album')',, '('digital album')',, '('ep')',, '('lp')',, '('single')',)

[#3]
T=5
! Remove Text (Acoustic, Album, Digital Album, EP, LP and Single) from TITLE=
f=TITLE
1=$replace(%title%, '(acoustic')',, ''album')',, '('digital album')',, '('ep')',, '('lp')',, '('single')',)

You can test your strings in Convert>Tag-Tag.
I don't get an error in the string for _directory.
I get one for _filename probably as

should be '('acoustic')'
ALBUM seems to be OK
TITLE has the same string as _filename and is not OK.

Thanks, a few errors!

[#0]
T=5
! Remove Text (Album, Digital Album, EP, LP and Single) DIRECTORY=
F=_DIRECTORY
1=$replace(%_directory%, '('album')',, '('digital album')',, '('ep')',, '('lp')',, '('single')',)

[#1]
T=5
! Remove Text (Acoustic, Album, Digital Album, EP, LP and Single) from FILENAME=
F=_FILENAME
1=$replace(%_filename%, '('acoustic')',, '('album')',, '('digital album')',, '('ep')',, '('lp')',, '('single')',)

[#2]
T=5
! Remove Text (Album, Digital Album, EP, LP and Single) from ALBUM=
F=_ALBUM
1=$replace(%_album%, '('album')',, '('digital album')',, '('ep')',, '('lp')',, '('single')',)

[#3]
T=5
! Remove Text (Acoustic, Album, Digital Album, EP, LP and Single) from TITLE=
f=TITLE
1=$replace(%title%, '('acoustic')',, '('album')',, '('digital album')',, '('ep')',, '('lp')',, '('single')',)

Is there something wrong with this? It doesn't seem to do anything.

I don't know what the original data looks like ... so I cannot tell if there would be any hits.
Perhaps it is somewhere along this line: $replace() is case sensitive.

Okay, I think the problem could be bigger than this.

I'm getting an error when I try closing MP3tag now. I don't even have a y drive?

================================================================================
Mp3tag v3.02 - 09.08.2020 - 14:01:21

OS-Version: Windows 10, 64-bit

Build: Jul 11 2020 11:14:04

AppPath: 114.270.347.264 Bytes frei (C:\Program Files (x86)\Mp3tag)
DataPath: 114.270.347.264 Bytes frei (C:\Users\user\AppData\Roaming\Mp3tag\data)
TempPath: 114.270.347.264 Bytes frei (C:\Users\user\AppData\Local\Temp\Mp3tag v3.02)

================================================================================
ERROR

File: y:\projects_main\szipfile.cpp
Line: 302
Expression: _S_TRUE(bRetVal)
LastError: 0x00000000 The operation completed successfully.


THROW

File: y:\projects_main\szipfile.cpp
Line: 377

THROW

File: y:\projects\mp3tag\mtconfigurationexporter.cpp
Line: 79

CATCH

File: y:\projects\mp3tag\mtdocument.cpp
Line: 132

@Florian Could you please tell me what this is?

It could be that, as you are manipulating the filename and the folder name in an action group that you cause access violations.

Try to separate the actions that treat the file attributes from those that edit the tag fields.

Quite honestly: why don't you prepare the tag fields and then generate filenames and folder names from the modified tag fields?

1 Like

I like the option to run a script as/when instances come up.

I just checked and every time I close mp3tag now, without running any actions, I'm getting the error.

@Florian

It could be that the file mp3tag.cfg and others are still blocked by the OS due to the previous crash.
See if a new start remedies the problem.
If not, I would assume that something corrupted MP3tag files. Perhaps a new installation then helps.

Oh damn, even a reinstall of the program isn't fixing it. I'll try restarting the laptop.

and then there is always the possibility that a file is up the spout and needs fixing.

Restart didn't work, do you understand the error log?

It looks to me like the configuration file could not be written, i.e. is corrupt. So if you rename the mp3tag.cfg file and the file Mp3tagsettings.zip while MP3tag is not running and then start MP3tag successfully, it was those files.
You loose the customization, though.

Thanks for your suggestion. I renamed the files and loaded up mp3tag. When I tried to close again, it came up with an error.

================================================================================
Mp3tag v3.02 - 09.08.2020 - 15:06:05

OS-Version: Windows 10, 64-bit

Build: Jul 11 2020 11:14:04

AppPath: 120.577.970.176 Bytes frei (C:\Program Files (x86)\Mp3tag)
DataPath: 120.577.970.176 Bytes frei (C:\Users\user\AppData\Roaming\Mp3tag\data)
TempPath: 120.577.970.176 Bytes frei (C:\Users\user\AppData\Local\Temp\Mp3tag v3.02)

================================================================================
ERROR

File: y:\projects_main\szipfile.cpp
Line: 302
Expression: _S_TRUE(bRetVal)
LastError: 0x00000000 The operation completed successfully.


THROW

File: y:\projects_main\szipfile.cpp
Line: 377

THROW

File: y:\projects\mp3tag\mtconfigurationexporter.cpp
Line: 79

CATCH

File: y:\projects\mp3tag\mtdocument.cpp
Line: 132

I am now past my ideas - you need a clean installation, don't know what happened in the meantime.

I am still getting errors after reinstalling.

My advice would be to get out of the Program Files (x86) folder. Windows believes it owns that folder along with any programs "installed" there and it appears that your config info is held in AppData\Roaming (etc).

You should test by downloading and extracting the Mp3tag zip file into a subfolder of your downloads directory. Go into that subfolder and start by double-clicking on Mp3tag.exe

This will ensure that you will be starting with a "clean" instance of Mp3tag.

Please see if you continue to get errors.

Thanks for your reply.

I did a new install in A:\Downloads\Mp3tag and ran it from that directory and I'm still getting errors.