# if? command?

**URL:** https://community.mp3tag.de/t/if-command/11960
**Category:** Support
**Created:** [May 3, 2011, 6:52am UTC](https://community.mp3tag.de/t/if-command/11960 "2011-05-03T06:52:23Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![fuzzbass45](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/bbce88/32.png) [@fuzzbass45](https://community.mp3tag.de/u/fuzzbass45)
#### Post date: [May 3, 2011, 6:52am UTC](https://community.mp3tag.de/t/if-command/11960/1 "2011-05-03T06:52:23Z")

</div>

I want to copy my sort composer tags to the composer tag:

Action type: Format value  
Field: COMPOSER  
Format string: %composersort%

but I only want to copy across names that do not have commas in them (i.e single surnames, no christian names or multiple composers)

weston  
smith  
ninja

etc.

not and tags such as

hansen, paul  
apple, bob  
ghost, mr

Is there such a thing as an "If" command I can insert?

Many Thanks

Steve 45

---

<div class="post-metadata">

### Author: ![anon40688970](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/898d66/32.png) [@anon40688970](https://community.mp3tag.de/u/anon40688970)
#### Post date: [May 3, 2011, 7:36am UTC](https://community.mp3tag.de/t/if-command/11960/2 "2011-05-03T07:36:38Z")

</div>

This one should do the job (please test):

```
Action type: Format value
Field: COMPOSER
Format string: $ifgreater(strchr(%COMPOSERSORT%,','),0,%COMPOSER%,%COMPOSERSORT%)

```

Functions are described in the help topic on Scripting.

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [May 3, 2011, 8:32am UTC](https://community.mp3tag.de/t/if-command/11960/3 "2011-05-03T08:32:50Z")

</div>

> [@Steve45](#):
>
> I want to copy my sort composer tags to the composer tag:  
> Action type: Format value  
> Field: COMPOSER  
> Format string: %composersort%  
> but I only want to copy across names that do not have commas in them ...

To get an overview what tracks will be involved in your action, you can apply a Filter expression at first:

**"$ifgreater($strchr(%COMPOSERSORT%,','),0,1,0)" IS 1**

DD.20110503.1236.CEST

---

<div class="post-metadata">

### Author: ![fuzzbass45](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/bbce88/32.png) [@fuzzbass45](https://community.mp3tag.de/u/fuzzbass45)
#### Post date: [May 3, 2011, 10:06am UTC](https://community.mp3tag.de/t/if-command/11960/4 "2011-05-03T10:06:18Z")

</div>

Many thanks to you both. Am about to try. Somehow after installing an update to iTunes, around 10,000 tracks lost their composer tags, still got the sort composer tags, but they are in a different format! I had just bought a backup harddrive a couple of days before and was just tidying up before backing up to it! Sods law I think...

Steve 45

> [@DetlevD](#):
>
> To get an overview what tracks will be involved in your action, you can apply a Filter expression at first:
> 
> **"$ifgreater($strchr(%COMPOSERSORT%,','),0,1,0)" IS 1**
> 
> DD.20110503.1236.CEST

---

<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:23pm UTC](https://community.mp3tag.de/t/if-command/11960/5 "2026-02-09T12:23:04Z")

</div>


