# Request: Conditional Actions

**URL:** https://community.mp3tag.de/t/request-conditional-actions/2394
**Category:** General Discussion
**Created:** [October 23, 2005, 5:51am UTC](https://community.mp3tag.de/t/request-conditional-actions/2394 "2005-10-23T05:51:23Z")
**Posts on this page:** 5
**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: [October 23, 2005, 5:51am UTC](https://community.mp3tag.de/t/request-conditional-actions/2394/1 "2005-10-23T05:51:23Z")

</div>

I have a number of Actions defined that I'd like to be able to use on different kinds of files - mp3, flac, ape, ogg, etc.

Unfortunately, the tag names differ in the different file types. Using the suggestion of someone in these forums, I have some Actions defined with a series of rules like the following:

Format value "ALBUMSORT": $if($eql(%\_extension%,flac),%tmp\_artistsort%|%year%|%tmp\_albumsort%,)

Format value "TSOA": $if($eql(%\_extension%,mp3),%tmp\_artistsort%|%year%|%tmp\_albumsort%,)

It sure would make life easier if there where some type of mechanism where the field name itself could be variable, based upon the file type (or the extension). If this capability exists now, or if there's a way to do the above example with a single rule, then I'd love to hear about it.

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [October 25, 2005, 4:43pm UTC](https://community.mp3tag.de/t/request-conditional-actions/2394/2 "2005-10-25T16:43:41Z")

</div>

I'll add something like this to the next release.

Best regards,  
~ Florian

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [October 29, 2005, 6:19pm UTC](https://community.mp3tag.de/t/request-conditional-actions/2394/3 "2005-10-29T18:19:02Z")

</div>

This can now be done with the latest [Development Build](http://developer.mp3tag.de) by using scripting functions at both the Source format and the Guessing pattern at the action type Guess values.

For your example, just use these strings:

Source format %tmp\_artistsort%|%year%|%tmp\_albumsort%

Guessing pattern $if($eql(%\_extension%,flac),%%ALBUMSORT%%,$if($eql(%\_extension%,mp3),%%TSOA%%,))

Best regards,  
~ Florian

P.S. Thanks to dano, for the original idea for this solution 🙂

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [November 1, 2005, 6:59pm UTC](https://community.mp3tag.de/t/request-conditional-actions/2394/4 "2005-11-01T18:59:11Z")

</div>

I had to revert the changes from 2.33c to 2.33d, because it broke other things (mainly the basic formatstrings).

Sorry for that - maybe I'll find another solution.

Best regards,  
~ Florian

---

<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: [November 15, 2005, 8:28pm UTC](https://community.mp3tag.de/t/request-conditional-actions/2394/5 "2005-11-15T20:28:31Z")

</div>

> [@](#):
>
> I had to revert the changes from 2.33c to 2.33d, because it broke other things (mainly the basic formatstrings).
> 
> Sorry for that - maybe I'll find another solution.

Thanks for the effort Florian. I'm afraid I tried the solution, but didn't find it any easier to use. It was confusing and very difficult to read. Also, for more than two codecs or extensions, the old way was much easier. Hopefully some clear syntax can be devised, perhaps a new type of action.
