Is it possible to delete all existing fields with a Web Source Script?

Imagine getting an album full of fields you don't want.

Do we have a way to delete all existing (found) fields at the start of a Web Source Script to have full control over what the following script writes into to the files?

(I know that I could use an Action "Remove Fields expect".
But I'm looking for a "script-only" solution.)

Any ideas on how to do this if you don't know which fields exist?

I have an Action Group who does this, to me it's helpful to cleanse tags to get rid of all fields I consider useless:

T=10
F=ALBUM;ALBUMARTIST;ARTIST;COVER;GENRE;TITLE;TRACK;YEAR

[#1]
T=4
[#0]
F=TITLE
1=\[.+?\]
2=
3=0

[#2]
T=4
F=ALBUM
1=\[.+?\]
2=
3=0

[#3]
T=4
F=TITLE
1=\(.+?\)
2=
3=0

[#4]
T=4
F=ALBUM
1=\(.+?\)
2=
3=0

The last 4 ones are to erase all parenthesis and its contents btw. I hope this would be helpful for you.

Thank you for your (first) answer @Jaeger1349

As I wrote above:

I'm looking for a Web Source Script solution and that's why I wrote my question in this category Development > Web Sources Discussion.

BTW:
Have you ever tested your posted MTA Action?

If you really use it this way, you always delete your covers! Because

Preserving embedded cover art

Use PICTURE as field name if you want to preserve embedded cover art.


Update 02.04.2025:
For future readers from the updated documentation including COVER or PICTURE

I don't know really if it's necessary a script to do what you want, with an action group it's more than ok.

PS: yeah, I use it all the time and the front cover (the one image that i use for my files) it remains without problem.

If you use

then you keep a user-defined field called COVER (which is probably not there anyway) but most likely not the embedded picture as the field name for that is PICTURE as written in the documentation and quoted by @LyricsLover.

Both COVER and PICTURE are preserving embedded cover art (only the latter is documented I've now updated the documentation to include both).

Well, that's strange, because i don't remember creating any user-defined field for the cover image, i always believed that I used the default one, but nm, it works fine for me lol.

Thanks for the clarification :slight_smile:

No, it's always a merge operation in the Windows version of Mp3tag. The macOS version is slightly different as it provides means to overwrite existing or merge with existing tag fields.

However, it's not possible to influence this from a Tag Source. This is intended and by design.