# $if Artist - Title (Mix) \[Publisher\]

**URL:** https://community.mp3tag.de/t/if-artist-title-mix-publisher/66482
**Category:** Mac
**Created:** [November 9, 2024, 7:04pm UTC](https://community.mp3tag.de/t/if-artist-title-mix-publisher/66482 "2024-11-09T19:04:21Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![sparky79](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sparky79](https://community.mp3tag.de/u/sparky79)
#### Post date: [November 9, 2024, 7:04pm UTC](https://community.mp3tag.de/t/if-artist-title-mix-publisher/66482/1 "2024-11-09T19:04:21Z")

</div>

I'm hoping someone can help me create an "IF" argument to generate tag fields based upon the structure of the filename, for example:  
"K Klass - Rhythm Is A Mystery (Percussion Mix) [Deconstruction]"

Would become:  
"Artist - Title (Mix) [Publisher]"

If the [Publisher] is not present then parse as "Artist - Title (Mix)"

I've tried the below using "Import tag fields", the first part is successful but the second part without the publisher fails.  
$ifeql($strstr(%\_FILENAME%,%DUMMY% - %DUMMY% (%DUMMY%) [%DUMMY%]),0,%ARTIST% - %TITLE% (%MIXARTIST%) [%PUBLISHER%],%ARTIST% - %TITLE% (%MIXARTIST%))

Any help is appreciated.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [November 9, 2024, 7:45pm UTC](https://community.mp3tag.de/t/if-artist-title-mix-publisher/66482/2 "2024-11-09T19:45:54Z")

</div>

I think that you have to use a filter to get the data from the filenames with different patterns.  
e.g.  
%\_filename% HAS "["  
for the ones with the publisher and  
NOT %\_filename% HAS "["  
for the ones without.

Please note that %dummy% only works in matching format strings but the scripting function has to generate a format string first, so that is a generating format string.

You could try an action of the type "Import fields" with  
Source: `$if($grtr($strstr(%_filename%,'['),0),$regexp(%_filename%,'(.*) - (.*) \((.*)\) \[(.*)\]',$1==$2==$3==$4),$regexp(%_filename%,'(.*) - (.*) \((.*)\)',$1==$2==$3==)) `  
Target format string: `%artist%==%title%==%mixartist%==%publisher%`

If there is no data in the square brackets, no data i written to %publisher% and as empty fields do not exist, it will not be included in the file.

---

<div class="post-metadata">

### Author: ![sparky79](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sparky79](https://community.mp3tag.de/u/sparky79)
#### Post date: [November 9, 2024, 8:04pm UTC](https://community.mp3tag.de/t/if-artist-title-mix-publisher/66482/3 "2024-11-09T20:04:40Z")

</div>

Thank you very much, that works exactly as expected. 🙏

Do you know if there a way to retain the information in the fields containing data that aren't targeted by "%artist%==%title%==%mixartist%==%publisher%", or is this an unfortunate side effect of the process?

Thanks again.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [November 9, 2024, 8:07pm UTC](https://community.mp3tag.de/t/if-artist-title-mix-publisher/66482/4 "2024-11-09T20:07:34Z")

</div>

I don't know what you mean.  
When you import data into fields, only these get modified and those which were filled before, are kept.

---

<div class="post-metadata">

### Author: ![sparky79](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sparky79](https://community.mp3tag.de/u/sparky79)
#### Post date: [November 9, 2024, 8:23pm UTC](https://community.mp3tag.de/t/if-artist-title-mix-publisher/66482/5 "2024-11-09T20:23:39Z")

</div>

Unfortunately it wipes the other fields as seen in the screenshots:

> **Before**
>
> ![Before](https://community.mp3tag.de/uploads/default/original/3X/6/d/6d1b31d4f15ae7ff1144176230744ac844358441.jpeg)

> **After**
>
> ![After](https://community.mp3tag.de/uploads/default/original/3X/0/3/03eb4f95f34e2f97c644a802bd2263fc1fe203b3.jpeg)

No big deal, I'll try and work with it if it's part and parcel.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [November 9, 2024, 8:26pm UTC](https://community.mp3tag.de/t/if-artist-title-mix-publisher/66482/6 "2024-11-09T20:26:06Z")

</div>

What kind of files are these?  
MP3?  
Do they have APE tags?  
Which tags do you read and write?

---

<div class="post-metadata">

### Author: ![sparky79](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sparky79](https://community.mp3tag.de/u/sparky79)
#### Post date: [November 9, 2024, 8:39pm UTC](https://community.mp3tag.de/t/if-artist-title-mix-publisher/66482/7 "2024-11-09T20:39:24Z")

</div>

They're 320 .mp3 files, i'm not aware of them having APE tags.

Basically my workflow is to

1. Strip most of the data from the files other than filename, beatport track id and a few other fields.
2. Run through One Tagger to gather the relevant track information and add any tags such as mood and instrumentation.
3. Run through mixed in key.
4. Final tidy up in mp3tag.
5. Import into Rekordbox.

The main tags i read and write are filename, artist, title, mixartist, publisher, comments.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [November 9, 2024, 8:40pm UTC](https://community.mp3tag.de/t/if-artist-title-mix-publisher/66482/8 "2024-11-09T20:40:50Z")

</div>

If you have a column that shows the tag and the read tags, you might find the string APE.

Or apply a filter with  
%\_tag% HAS APE  
and see if any files pop up.

---

<div class="post-metadata">

### Author: ![sparky79](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sparky79](https://community.mp3tag.de/u/sparky79)
#### Post date: [November 9, 2024, 8:47pm UTC](https://community.mp3tag.de/t/if-artist-title-mix-publisher/66482/9 "2024-11-09T20:47:08Z")

</div>

My tags read as ID3v2.3 (ID3v1 ID3v2.3)

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [November 9, 2024, 8:48pm UTC](https://community.mp3tag.de/t/if-artist-title-mix-publisher/66482/10 "2024-11-09T20:48:22Z")

</div>

OK, now I am out of clues - perhaps some folks that know Macs better can help.

---

<div class="post-metadata">

### Author: ![sparky79](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sparky79](https://community.mp3tag.de/u/sparky79)
#### Post date: [November 9, 2024, 8:50pm UTC](https://community.mp3tag.de/t/if-artist-title-mix-publisher/66482/11 "2024-11-09T20:50:39Z")

</div>

Thank you very much for your help, it's sincerely appreciated. 💙

---

<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 10, 2024, 4:16pm UTC](https://community.mp3tag.de/t/if-artist-title-mix-publisher/66482/12 "2024-11-10T16:16:43Z")

</div>

> [@sparky79](#):
>
> Unfortunately it wipes the other fields

I've just double-checked and it doesn't wipe the fields — this would be an issue that needs fixing.

Can you check that none of the other steps wipe the fields, and if not, the Tag-writing settings are similar to

 ![image](https://community.mp3tag.de/uploads/default/original/3X/7/3/73dae14118d0eacfa91c282e2bbecf7ece663b50.jpeg)

---

<div class="post-metadata">

### Author: ![sparky79](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sparky79](https://community.mp3tag.de/u/sparky79)
#### Post date: [November 11, 2024, 7:11pm UTC](https://community.mp3tag.de/t/if-artist-title-mix-publisher/66482/13 "2024-11-11T19:11:58Z")

</div>

Sorry for delayed response.

The above solution provided by ohrenkino does now indeed work as intended.  
I removed all actions I had created and rebuilt them. Just to close off with your post, my tag type settings are set as shown in the screenshot also.

Thank you both your help. 💙

---

<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: [December 11, 2024, 7:12pm UTC](https://community.mp3tag.de/t/if-artist-title-mix-publisher/66482/14 "2024-12-11T19:12:11Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
