# Compilation = 1 based on string content possible?

**URL:** https://community.mp3tag.de/t/compilation-1-based-on-string-content-possible/59119
**Category:** Mac
**Created:** [November 19, 2022, 7:40pm UTC](https://community.mp3tag.de/t/compilation-1-based-on-string-content-possible/59119 "2022-11-19T19:40:23Z")
**Posts on this page:** 1
**Showing post:** 6

<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 20, 2022, 2:32pm UTC](https://community.mp3tag.de/t/compilation-1-based-on-string-content-possible/59119/6 "2022-11-20T14:32:07Z")

</div>

> [@npx](#):
>
> $if($contains(%mediatype%,'Compilation')$set('Compilation','1')

See the documentation on scripting functions:

> [@Scripting Functions](https://community.mp3tag.de/t/scripting-functions/51689):
>
> Mp3tag offers various built-in scripting functions, which can be used at various places in the program. These functions offer advanced display and converting options and are to be used in combination with [Format Strings and Available Placeholders](https://community.mp3tag.de/t/format-strings-and-available-placeholders/51688). General Functions Replace $replace(string,from,to) or $replace(string,from1,to1,from2,to2,...) Example: $replace(%title%,\_,-) This example replaces all underscores with dashes. You can provide additional pairs of from/to as parameters. Case Co…

$contains would probably be $strstr()  
You would need something like  
`$ifgreater($strstr(%mediatype%,Compilation),0,1,)`

---

_[View the full topic](https://community.mp3tag.de/t/compilation-1-based-on-string-content-possible/59119)._
