# Conditional Actions?

**URL:** https://community.mp3tag.de/t/conditional-actions/2270
**Category:** Support
**Created:** [September 10, 2005, 1:59am UTC](https://community.mp3tag.de/t/conditional-actions/2270 "2005-09-10T01:59:38Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![JJ\_Johnson](https://community.mp3tag.de/user_avatar/community.mp3tag.de/jj_johnson/32/67_2.png) [@JJ\_Johnson](https://community.mp3tag.de/u/JJ_Johnson)
#### Post date: [September 10, 2005, 1:59am UTC](https://community.mp3tag.de/t/conditional-actions/2270/1 "2005-09-10T01:59:38Z")

</div>

Is there any way to have an action behave according to the file type (or extension) of the file being tagged? As in:

```
if (filetype == MP3)
  add TSOP tag
elseif (filetype == FLAC)
  add ARTISTSORT

```

If this could be done then it would save me from having a set of actions for FLAC files and then another similar set for MP3 files and needing to select from them according to the file(s) that I'm tagging.

---

<div class="post-metadata">

### Author: ![nickless](https://community.mp3tag.de/user_avatar/community.mp3tag.de/nickless/32/36_2.png) [@nickless](https://community.mp3tag.de/u/nickless)
#### Post date: [September 10, 2005, 12:02pm UTC](https://community.mp3tag.de/t/conditional-actions/2270/2 "2005-09-10T12:02:39Z")

</div>

I'm not sure about names of tag fields because I don't use Flac format and I've never heard about TSOP field, but you could add a set of Actions with 2 Actions of type "Format Tag-Fields":

```
First Action:
Field: TSOP
Formatstring: $if($eql(%_codec%,MPEG 1 Layer III),What_you_want_to_add,) //or use %_extension% instead of %_codec%

Second Action:
Field: ARTISTSORT
Formatstring: $if($eql(%_codec%,FLAC),What_you_want_to_add,) //not sure if name of codec is correct

```

It will write some information to the choosen field only if the file format is correct.

Regards  
nickless

---

<div class="post-metadata">

### Author: ![JJ\_Johnson](https://community.mp3tag.de/user_avatar/community.mp3tag.de/jj_johnson/32/67_2.png) [@JJ\_Johnson](https://community.mp3tag.de/u/JJ_Johnson)
#### Post date: [September 13, 2005, 3:55pm UTC](https://community.mp3tag.de/t/conditional-actions/2270/3 "2005-09-13T15:55:56Z")

</div>

> [@](#):
>
> you could add a set of Actions with 2 Actions of type "Format Tag-Fields":

Thanks, that worked well. A little awkward, but it works.

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [February 9, 2026, 12:19pm UTC](https://community.mp3tag.de/t/conditional-actions/2270/4 "2026-02-09T12:19:27Z")

</div>


