# Format a field based on a specific condition

**URL:** https://community.mp3tag.de/t/format-a-field-based-on-a-specific-condition/13400
**Category:** Web Sources Discussion
**Created:** [May 6, 2012, 8:22pm UTC](https://community.mp3tag.de/t/format-a-field-based-on-a-specific-condition/13400 "2012-05-06T20:22:14Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ra7h35m20s](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/779978/32.png) [@ra7h35m20s](https://community.mp3tag.de/u/ra7h35m20s)
#### Post date: [May 6, 2012, 8:22pm UTC](https://community.mp3tag.de/t/format-a-field-based-on-a-specific-condition/13400/1 "2012-05-06T20:22:14Z")

</div>

Hello to all those scripting gurus out in MP3Tag land! I am hoping that someone will be able to help me with directions....

I am hoping there is a way to trigger an action based on criteria of one field and then update another field.

For example:  
Field CHECKDIGIT -- possible values -- 0, 1, 2, 3, 4 or 5  
Depending on value of CHECKDIGIT I want to update the DESCRIPTION field with a value.

So basically,

Select Case CHECKDIGIT  
Case 0

```
 DESCRIPTION = "This Value"

```

Case 1

```
 DESCRIPTION = "A different Value"

```

...  
End Select

What I am trying to do is find a way to fully automate some actions that I have ... Changing ARTISTS names to Last, First, moving The in ARTIST name to the end, etc. Right now I have what I named 'Master Format' that has about 30 separate actions in it but I can not find a way to incorporate what I described above.

I thought about nested $if() statements but alas have been unable to get that to work with the regexp for the field adjustments. So, since I know there is really no such thing in the MP3Tag scripting language for the Select...Case statement does anyone know of a way that I can accomplish this?

Oh, and one final question ... is there a way to have an action trigger a script??
