# Boolean functions in Action Groups?

**URL:** https://community.mp3tag.de/t/boolean-functions-in-action-groups/14191
**Category:** Support
**Created:** [December 2, 2012, 10:40pm UTC](https://community.mp3tag.de/t/boolean-functions-in-action-groups/14191 "2012-12-02T22:40:39Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![aax](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/edb3f5/32.png) [@aax](https://community.mp3tag.de/u/aax)
#### Post date: [December 2, 2012, 10:40pm UTC](https://community.mp3tag.de/t/boolean-functions-in-action-groups/14191/1 "2012-12-02T22:40:39Z")

</div>

I would like to create a couple of actions that function according to the file type they're used for, so that I don't have to select between multiple actions for flac, mp3 or mp4 every time. Hopefully that's possible.  
I was looking at Boolean functions in Help but I can't exactly figure out how to configure them, so I would really appreciate if someone could give me an example.

Specifically I would like like to use "Remove fields except" actions that would remove different fields for FLAC and mp3 files. I would prefer an action group with seperate actions for each file type, so I can easily add other types in the future. For example something like this:

**Action Group:**

**action 1:** if selected file's extension is .mp3, remove fields except _field1;field2;field3,_ otherwise do nothing

**action 2:** if selected file's extension is .flac, remove fields except _field1;field2,_ otherwise do nothing

---

<div class="post-metadata">

### Author: ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)
#### Post date: [December 2, 2012, 11:19pm UTC](https://community.mp3tag.de/t/boolean-functions-in-action-groups/14191/2 "2012-12-02T23:19:17Z")

</div>

> [@aax](#):
>
> remove fields except _field1;field2;field3,_ otherwise do nothing

The remove fields except action does not support Scripting functions. The best you can do is use separate actions like you describe.

Or you can set up one action group like the following:

Begin Action Group **\_Script Test#TEST REMOVE EXCEPT fields in flac, mp3 + mp4**

**Action #1** _Actiontype 5:_ **Format value** _Field \_\_\_\_\_\_:_ **REMIXER** _Formatstring:_ **$if($eql(%\_extension%,mp3),,%remixer%)****Action #2 **_Actiontype 5:_** Format value **_Field \_\_\_\_\_\_:_** YEAR **_Formatstring:_** $if($eql(%\_extension%,mp3),,%year%) ****Action #3** _Actiontype 5:_ **Format value** _Field \_\_\_\_\_\_:_ **UNSYNCEDLYRICS** _Formatstring:_ **$if($eql(%\_extension%,flac),,%unsyncedlyrics%)****Action #4 **_Actiontype 5:_** Format value **_Field \_\_\_\_\_\_:_** COMMENT **_Formatstring:_** $if($eql(%\_extension%,flac),,%comment%)**

End Action Group **\_Script Test#TEST REMOVE EXCEPT fields in flac, mp3 + mp4** (4 Actions)

Action #1 will remove **REMIXER** field if the extention is mp3  
Action #2 will remove **YEAR** field if the extention is mp3  
 Action # **3** will remove **UNSYNCEDLYRICS** field if the extention is flac  
Action #4 will remove **COMMENT** field if the extention is flac

---

<div class="post-metadata">

### Author: ![aax](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/edb3f5/32.png) [@aax](https://community.mp3tag.de/u/aax)
#### Post date: [December 2, 2012, 11:46pm UTC](https://community.mp3tag.de/t/boolean-functions-in-action-groups/14191/3 "2012-12-02T23:46:13Z")

</div>

Thanks, I'll stick with my separate action groups and "remove fields except" then. It's simpler than writing actions for all possible fields.

By the way, how would I use...

Format value: TRACK: %\_counter%/%\_total\_files%  
_(for mp3 files)_

Format value: TRACK: %\_counter%,  
Format value: TRACKTOTAL:%\_total\_files%  
_(for flac files)_

...in the same action group?

---

<div class="post-metadata">

### Author: ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)
#### Post date: [December 3, 2012, 12:48am UTC](https://community.mp3tag.de/t/boolean-functions-in-action-groups/14191/4 "2012-12-03T00:48:27Z")

</div>

> [@aax](#):
>
> ...in the same action group?

Begin Action Group **\_Script Test#TEST**

**Action #1** _Actiontype 5:_ **Format value** _Field \_\_\_\_\_\_:_ **TRACK** _Formatstring:_ **$if($eql(%\_extension%,mp3),%\_counter%/%\_total\_files%,%track%)****Action #2 **_Actiontype 5:_** Format value **_Field \_\_\_\_\_\_:_** TRACK **_Formatstring:_** $if($eql(%\_extension%,flac),%\_counter%,%track%) ****Action #3** _Actiontype 5:_ **Format value** _Field \_\_\_\_\_\_:_ **TRACKTOTAL** _Formatstring:_ **$if($eql(%\_extension%,flac),%\_total\_files%,%tracktotal%)**

End Action Group **\_Script Test#TEST** (3 Actions)

---

<div class="post-metadata">

### Author: ![aax](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/edb3f5/32.png) [@aax](https://community.mp3tag.de/u/aax)
#### Post date: [December 3, 2012, 1:18am UTC](https://community.mp3tag.de/t/boolean-functions-in-action-groups/14191/5 "2012-12-03T01:18:54Z")

</div>

Brilliant, thanks.  
Just one questions, though. What will the **z** values in those three functions do (%track%, %track% and %tracktotal%) if **x** values are not true (wrong extension)? Shouldn't the **z** values be empty?

---

<div class="post-metadata">

### Author: ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)
#### Post date: [December 3, 2012, 1:55am UTC](https://community.mp3tag.de/t/boolean-functions-in-action-groups/14191/6 "2012-12-03T01:55:22Z")

</div>

You want to keep whatever is existing in that field regardless if you want the same actions in the one group. The z value corresponding to the format value keeps what's existing in that field (whether empty or filled).

**Action #1** will take care of _TRACK_ if it's an _mp3_

**Action #2** will take care of _TRACK_ if it's _flac_ It all works itself out when you run the single action.

---

<div class="post-metadata">

### Author: ![aax](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/edb3f5/32.png) [@aax](https://community.mp3tag.de/u/aax)
#### Post date: [December 3, 2012, 11:28am UTC](https://community.mp3tag.de/t/boolean-functions-in-action-groups/14191/7 "2012-12-03T11:28:06Z")

</div>

Got it! Thanks

---

<div class="post-metadata">

### Author: ![aax](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/edb3f5/32.png) [@aax](https://community.mp3tag.de/u/aax)
#### Post date: [December 8, 2012, 1:30am UTC](https://community.mp3tag.de/t/boolean-functions-in-action-groups/14191/8 "2012-12-08T01:30:21Z")

</div>

> [@](#):
>
> The "remove fields except" action does not support Scripting functions.

And what about regular "Remove fields" action, does it support scripting?

---

<div class="post-metadata">

### Author: ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)
#### Post date: [December 8, 2012, 10:45am UTC](https://community.mp3tag.de/t/boolean-functions-in-action-groups/14191/9 "2012-12-08T10:45:25Z")

</div>

> [@aax](#):
>
> And what about regular "Remove fields" action, does it support scripting?

No, please read [Scripting Functions – Mp3tag Documentation](http://help.mp3tag.de/main_scripting.html) at the part where it says where scripting is available in mp3tag.

---

<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:24pm UTC](https://community.mp3tag.de/t/boolean-functions-in-action-groups/14191/10 "2026-02-09T12:24:12Z")

</div>


