# ACTIONS that mimics a WYSIWYG to Change File Extension or File Name and Extension (2022-2023)

**URL:** https://community.mp3tag.de/t/actions-that-mimics-a-wysiwyg-to-change-file-extension-or-file-name-and-extension-2022-2023/60139
**Category:** General Discussion
**Created:** [February 20, 2023, 10:00pm UTC](https://community.mp3tag.de/t/actions-that-mimics-a-wysiwyg-to-change-file-extension-or-file-name-and-extension-2022-2023/60139 "2023-02-20T22:00:48Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![wneclass2018](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/w/cdc98d/32.png) [@wneclass2018](https://community.mp3tag.de/u/wneclass2018)
#### Post date: [February 20, 2023, 10:00pm UTC](https://community.mp3tag.de/t/actions-that-mimics-a-wysiwyg-to-change-file-extension-or-file-name-and-extension-2022-2023/60139/1 "2023-02-20T22:00:48Z")

</div>

1. UNIVERSAL File Extension (%\_extension%) CHANGER by wneclass2018 (October 12th 2022) (Updated 12-29-2022).mta  
[UNIVERSAL File Extension (%\_extension%) CHANGER by wneclass2018 (October 12th 2022) (Updated 12-29-2022).mta](https://community.mp3tag.de/uploads/short-url/4qqECql64hNFbdjjfQxexbbU88t.mta) (953 Bytes)

2. Change BOTH File Name (%\_filename%) and File Extension (%\_extension%) by wneclass2018 (December 29th 2022).mta  
[Change BOTH File Name (%\_filename%) and File Extension (%\_extension%) by wneclass2018 (December 29th 2022).mta](https://community.mp3tag.de/uploads/short-url/sMM9ubpYAaeHfDRB1kMngSXBw4U.mta) (1.0 KB)

3. CONVERT File Extension (%\_extension%) to Lowercase by wneclass2018 (February 20th 2023).mta  
[CONVERT File Extension (%\_extension%) to Lowercase by wneclass2018 (February 20th 2023).mta](https://community.mp3tag.de/uploads/short-url/6MrYXx5zKH3i4cH9cQMZSGahkBG.mta) (759 Bytes)

══════➤ ACCESS to ACTIONS (.mta) (AppData) Folder: %AppData%\Mp3tag\data\actions or C:\Users%username%\AppData\Roaming\Mp3tag\data\actions

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [February 21, 2023, 6:40am UTC](https://community.mp3tag.de/t/actions-that-mimics-a-wysiwyg-to-change-file-extension-or-file-name-and-extension-2022-2023/60139/2 "2023-02-21T06:40:40Z")

</div>

> [@wneclass2018](#):
>
> ACCESS to ACTIONS (.mta) (AppData) Folder: %AppData%\Mp3tag\data\actions or C:\Users%username%\AppData\Roaming\Mp3tag\data\actions

Please note that the actions folder may appear in various locations, depending on the way MP3tag was installed, be it the standard or the portable way.  
The easiest method to open the correct configuration folder would be to use the function in the File menu: Open configuration folder.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [February 21, 2023, 6:49am UTC](https://community.mp3tag.de/t/actions-that-mimics-a-wysiwyg-to-change-file-extension-or-file-name-and-extension-2022-2023/60139/3 "2023-02-21T06:49:20Z")

</div>

> [@wneclass2018](#):
>
> Change BOTH File Name (%\_filename%) and File Extension (%\_extension%) by wneclass2018 (December 29th 2022).mta

Somehow that action does not make any difference: upper case stays upper case, mixed case stays mixed case .. Do I really have to type in the new filename and the extension and then run the action? Wouldn't it then be much easier to do that in the file explorer which saves me the effort to create fields, write them, start the action and then delete them?  
And even though you claim to have a

> [@wneclass2018](#):
>
> WYSIWYG

way - it is not: if I enter e.g. mP3 as new file extension, the extension becomes lower case.  
Why doesn't the action create the fields it needs when all it does is to convert to lower case only any way?  
Where is the benefit that I have to create user-definded fields first, then apply the action, then delete these fields again?  
While a simple "Replace with regular expression" would serve the same purpose much quicker, see

> [@Change file extension to lowercase - Regular expression](https://community.mp3tag.de/t/change-file-extension-to-lowercase-regular-expression/59816):
>
> Seems like the regular expression thread is locked Previously found some nice examples there, why was it closed? Not an overly complex one but couldn't find it so posting here in case it's useful to someone else: Had a number of uppercase file extensions and was looking to convert them all to lowercase; there doesn't seem to be such a thing as the '"file extension" field so here's my take on it: Field : \_FILENAME Regular expression : \.(.\*)$ Replace with : .$lower($1) Cheers,

It could still be that I have simply not grasped what this should be all about.

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [February 21, 2023, 8:12am UTC](https://community.mp3tag.de/t/actions-that-mimics-a-wysiwyg-to-change-file-extension-or-file-name-and-extension-2022-2023/60139/4 "2023-02-21T08:12:04Z")

</div>

> [@ohrenkino](#):
>
> It could still be that I have simply not grasped what this should be all about.

I also do not see the problem. We can change the filename and/or extension with a regular expression, as already mentioned [here](https://community.mp3tag.de/t/change-file-extension-to-lowercase-regular-expression/59816).

To illustrate it:  
 ![Extension and Filename to lowercase](https://community.mp3tag.de/uploads/default/original/2X/e/e9af0a4432d718a2d505c1a9ff681dcfc849b67a.gif)

Action "Replace with regular expression" to change only the extension to lowercase:  
Field : \_FILENAME  
Regular expression: `\.(.*)$`  
Replace matches with: `.$lower($1)`

Action "Replace with regular expression" to change the filename including the extension to lowercase:  
Field : \_FILENAME  
Regular expression: `(.*)`  
Replace matches with: `$lower($1)`

**Update 22.02.2023, 08.45:**  
As @wneclass2018 stated later in this thread, there is a problem with the above regular expressions, if the filenames include (multiple) dots. Please use the updated versions [in this answer](https://community.mp3tag.de/t/actions-that-mimics-a-wysiwyg-to-change-file-extension-or-file-name-and-extension-2022-2023/60139/10).

---

<div class="post-metadata">

### Author: ![wneclass2018](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/w/cdc98d/32.png) [@wneclass2018](https://community.mp3tag.de/u/wneclass2018)
#### Post date: [February 21, 2023, 9:42am UTC](https://community.mp3tag.de/t/actions-that-mimics-a-wysiwyg-to-change-file-extension-or-file-name-and-extension-2022-2023/60139/5 "2023-02-21T09:42:29Z")

</div>

> [@ohrenkino](#):
>
> way - it is not: if I enter e.g. mP3 as new file extension, the extension becomes lower case.  
> Why doesn't the action create the fields it needs when all it does is to convert to lower case only any way?  
> Where is the benefit that I have to create user-definded fields first, then apply the action, then delete these fields again?  
> While a simple "Replace with regular expression" would serve the same purpose much quicker, see

WYSIWYG only applies to the first 2 actions. It doesn't apply to the "CONVERT File Extension (%\_extension%) to Lowercase by wneclass2018 (February 20th 2023).mta" since that .mta file was created convert uppercase extensions to lowercase.  
If you truly want a WYSIWYG with no restrictions (i.e. can add spaces as a extension), then you can use this string, without quotations, "%preserve\_original\_filename%.$if2(%NEW\_FILE\_EXTENSION%,%preserve\_original\_extension%)". Likewise, on a different mp3tag community forum, I explained it more in detail here: [Not possible to change filename w/ extension via file view - #6 by wneclass2018](https://community.mp3tag.de/t/not-possible-to-change-filename-w-extension-via-file-view/12107/6)

---

<div class="post-metadata">

### Author: ![wneclass2018](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/w/cdc98d/32.png) [@wneclass2018](https://community.mp3tag.de/u/wneclass2018)
#### Post date: [February 21, 2023, 9:58am UTC](https://community.mp3tag.de/t/actions-that-mimics-a-wysiwyg-to-change-file-extension-or-file-name-and-extension-2022-2023/60139/6 "2023-02-21T09:58:29Z")

</div>

> [@LyricsLover](#):
>
> We can change the filename and/or extension with a regular expression, as already mentioned [here](https://community.mp3tag.de/t/change-file-extension-to-lowercase-regular-expression/59816).

Yes, you can change it using your method, but my .mta allows you to freely type the extension that you desire into the required field "NEW\_FILE\_EXTENSION", and once you run the action, it will change the extension. I believed that I explained it thoroughly in this post: [Not possible to change filename w/ extension via file view - #5 by ptrk.mj](https://community.mp3tag.de/t/not-possible-to-change-filename-w-extension-via-file-view/12107/5) , and the only difference is that I changed the string, from the excerpt, [#3], on the December.

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [February 21, 2023, 10:02am UTC](https://community.mp3tag.de/t/actions-that-mimics-a-wysiwyg-to-change-file-extension-or-file-name-and-extension-2022-2023/60139/7 "2023-02-21T10:02:02Z")

</div>

> [@wneclass2018](#):
>
> but my .mta allows you to freely type the extension that you desire into the required field "NEW\_FILE\_EXTENSION", and once you run the action, it will change the extension.

You can freely type every extension you desire in every thinkable combination in the above regular expression. Just use  
Field : \_FILENAME  
Regular expression: `\.(.*)$`  
Replace matches with: `.xYZ` \<- type whatever you want to have as new extension

---

<div class="post-metadata">

### Author: ![wneclass2018](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/w/cdc98d/32.png) [@wneclass2018](https://community.mp3tag.de/u/wneclass2018)
#### Post date: [February 22, 2023, 1:42am UTC](https://community.mp3tag.de/t/actions-that-mimics-a-wysiwyg-to-change-file-extension-or-file-name-and-extension-2022-2023/60139/8 "2023-02-22T01:42:26Z")

</div>

> [@LyricsLover](#):
>
> You can freely type every extension you desire in every thinkable combination in the above regular expression. Just use  
> Field : \_FILENAME  
> Regular expression: `\.(.*)$`  
> Replace matches with: `.xYZ` \<- type whatever you want to have as new extension

True, but compared to mine, you can use a placeholder (i.e. format string, %NEW\_FILE\_EXTENSION%) to add different extensions, while your method, which I found a flaw, cuts texts if the filename has multiple periods, while mine doesn't do that. Likewise, I did manage to modify your regex to include multiple periods within the filename, and it's also useful when I want to change extension from mks to mka or mkv since, even though I can add it within the list of extension Mp3Tag can read, it cannot write tags into it. Nonetheless, here is a .gif(s) of mine, compared to yours, and I wonder how I can tag @ohrenkino since I replied to you, instead of him.

**1A) WNEClass2018 Method 01\_ Change BOTH Filename and Extension (using Filename and Extension MTA file)\_ 20230221\_161201**  
➖ Add different entries (i.e. change to .mp4, .mkv, .mks, etc as well including filename) into the placeholder displayed, compared to "2)" below.  
➖ You can change either BOTH filename and extension or just filename or just extension, but you have to make sure that either field(s) %NEW\_FILENAME% or %NEW\_FILE\_EXTENSION% are the same as the current %\_filename% or %_extension%, or the %NEW_...% fields are empty.  
 ![WNEClass2018 Method 01_ Change BOTH Filename and Extension (using Filename and Extension MTA file)_ 20230221_161201](https://community.mp3tag.de/uploads/default/original/2X/e/ea2ae10c35af11ef354429c1b4b665016beb0474.gif)

**1-B) WNEClass2018 Method 01-B\_ Change ONLY Extension (using Change Filename and Extension MTA file)\_ 20230221\_211757**  
➖ Deleted the entry in the field, NEW\_FILENAME, allowing me to only change the file extension without changing the filename. Likewise, this example mimics "2)" multiple periods, and changes the file extension, as intended, properly.  
 ![WNEClass2018 Method 01-B_ Change ONLY Extension (using Change Filename and Extension MTA file)_ 20230221_211757](https://community.mp3tag.de/uploads/default/original/2X/2/2775ed3c9e9ca893326a3b78141611a6692f80e1.gif)

**2) LyricsLover's Regexp METHOD\_ Changing File Extension (FAILS at MULTIPLE Periods)\_ 20230221\_162014**  
➖ Works, but changes the extension at "Patho." instead of at "Patho.physiology", and the same applies to "Drug Treat." to "Drug Treat.ment".  
 ![LyricsLover's Regexp METHOD_ Changing File Extension (FAILS at MULTIPLE Periods)_ 20230221_162014](https://community.mp3tag.de/uploads/default/original/2X/d/d0b6d0efae8b690ae5a3ee5e078c7452f19b8e80.gif)

**3) LyricsLover's MODIFIED (by WNEClass2018) Regexp METHOD\_ Changing File Extension (SUCCESS at MULTIPLE Periods)\_ 20230221\_162945**  
➖ Regex used, without quotations, "^(.\*)[.](.\*)$", and replace with "$1.ext". Corrects the multiple periods issue of "2)".  
➖ Regex OPTION II (using a positive look-behind & comprehensive list of Mp3Tag's readable/non-readable extensions) (without quotations): "(?\<=[.])((?:a(?:ac|[ai]f[cf]?|sf|p[el]|vi)|dsf|f(?:l[a]?c)|m(?:4[abvr]|k[avs]|ov|p[c1-4+])|o(?:f[rs]|g[ag]|pus)|spx|t(?:ak|ta|s)|w(?:[a]?v|ebm|ma)){1})$" and replace with "ext of choice" or "$lower($1)". Likewise, it also corrects the multiple periods issue of "2)".

![LyricsLover's MODIFIED (by WNEClass2018) Regexp METHOD_ Changing File Extension (SUCCESS at MULTIPLE Periods)_ 20230221_162945](https://community.mp3tag.de/uploads/default/original/2X/9/92d2b0a495077f6def0f9c38da1f3c81fd513ea4.gif)

**4) WNEClass2018 Method 02\_ Change ONLY Extension (using ONLY Extension MTA file)\_ 20230221\_164625**  
➖ This .MTA will ONLY change the file extension, WITHOUT any restrictions. This is WYSIWYG, but WITHOUT safe guards, compared to the ones I uploaded. I uploaded this version, from the same link I provided above, here: [UNIVERSAL File Extension CHANGER by wneclass2018 (October 12th 2022) (UNRESTRICTED ENTRY).mta](https://community.mp3tag.de/uploads/short-url/2PxacCsrxoZFeODbvWuGsPAbqno.mta)  
 ![WNEClass2018 Method 02_ Change ONLY Extension (using ONLY Extension MTA file)_ 20230221_164625](https://community.mp3tag.de/uploads/default/original/2X/2/23bb23102503bcb9aec5f282bdc286e0e566995b.gif)

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [February 22, 2023, 6:11am UTC](https://community.mp3tag.de/t/actions-that-mimics-a-wysiwyg-to-change-file-extension-or-file-name-and-extension-2022-2023/60139/9 "2023-02-22T06:11:22Z")

</div>

> [@wneclass2018](#):
>
> when I want to change extension from mks to mka or mkv since, even though I can add it within the list of extension Mp3Tag can read, it cannot write tags into it.

Please have a look at the supported file formats:

## Supported Audio Formats

- Advanced Audio Coding ([aac](https://wiki.hydrogenaud.io/index.php?title=Advanced_Audio_Coding))
- Apple Lossless Audio Codec ([alac](https://en.wikipedia.org/wiki/Apple_Lossless))
- Audio Interchange File Format ([aif / aifc / aiff](https://en.wikipedia.org/wiki/Audio_Interchange_File_Format))
- Direct Stream Digital Audio ([dsf](https://en.wikipedia.org/wiki/Direct_Stream_Digital))
- Free Lossless Audio Codec ([flac](https://xiph.org/flac/))
- Matroska ([mka / mkv](https://www.matroska.org))
- Monkey's Audio ([ape](https://monkeysaudio.com/))
- Mpeg Layer 3 ([mp3](https://en.wikipedia.org/wiki/MP3))
- MPEG-4 ([mp4 / m4a / m4b / m4v / iTunes](https://en.wikipedia.org/wiki/MPEG-4))
- Musepack ([mpc](https://www.musepack.net))
- Ogg Vorbis ([ogg](https://xiph.org/vorbis/))
- IETF Opus ([opus](https://opus-codec.org/))
- OptimFROG ([ofr / ofs](http://losslessaudio.org/))
- Speex ([spx](https://www.speex.org/))
- Tom's Audio Kompressor ([tak](http://www.thbeck.de/Tak/Tak.html))
- True Audio ([tta](http://tausoft.org/wiki/True_Audio_Codec_Overview))
- Windows Media Audio ([wma](https://en.wikipedia.org/wiki/Windows_Media_Audio))
- WavPack ([wv](https://www.wavpack.com))
- WAV ([wav](https://en.wikipedia.org/wiki/WAV))
- WebM ([webm](https://www.webmproject.org/))  
to be found on

> **[Mp3tag - the universal Tag Editor (ID3v2, MP4, OGG, FLAC, ...)](https://www.mp3tag.de/en/)**
>
> Mp3tag is a powerful and easy-to-use tool to edit metadata of audio files.

which means that tags can be written to mkv files.

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [February 22, 2023, 7:46am UTC](https://community.mp3tag.de/t/actions-that-mimics-a-wysiwyg-to-change-file-extension-or-file-name-and-extension-2022-2023/60139/10 "2023-02-22T07:46:31Z")

</div>

> [@wneclass2018](#):
>
> cuts texts if the filename has multiple periods

Thanks for letting me know the problem with multiple dots in filenames.  
I would solve it this way:

To change only the listed extensions of selected filenames to lowercase:  
**Action "Replace with regular expression"**  
**Field:** \_FILENAME  
**Regular expression:** `^(.*)(\.(mp3|m4a|flac|mp4|aac))$`  
**Replace matches with:** `$1$lower($2)`  
_(All not listed extensions will be ignored - you can adjust the list as you like)_

To change ALL extensions in the selected files to lowercase:  
**Field:** \_FILENAME  
**Regular expression:** `^(.*)(\.(.*))$`  
**Replace matches with:** `$1$lower($2)`

You could also replace the existing extension for all selected files to a fixed new extension  
like `.aBC` with  
**Replace matches with:** `$1.aBC`

To change only the filename in all selected files to lowercase, but let the extension untouched:  
**Field:** \_FILENAME  
**Regular expression:** `^(.*)(\.(.*))$`  
**Replace matches with:** `$lower($1)$2`

To change the entire filename - including the extension - for all selected files to lowercase:  
**Field:** \_FILENAME  
**Regular expression:** `(.*)`  
**Replace matches with:** `$lower($1)`

If I would like to rename files individually per track as you suggest with your MTA's, I would use a specialized [File Rename software](https://en.wikipedia.org/wiki/Batch_renaming#List_of_software) with all the whistle and bells.
