# How to execute a script in mp3tag

**URL:** <https://community.mp3tag.de/t/how-to-execute-a-script-in-mp3tag/60967>\
**Category:** Support\
**Created:** [May 14, 2023, 2:44am UTC](https://community.mp3tag.de/t/how-to-execute-a-script-in-mp3tag/60967 "2023-05-14T02:44:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![navarannan](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/n/3da27b/32.png) [@navarannan](https://community.mp3tag.de/u/navarannan)\
**Post date:** [May 14, 2023, 2:44am UTC](https://community.mp3tag.de/t/how-to-execute-a-script-in-mp3tag/60967/1 "2023-05-14T02:44:41Z")

</div>

Hi all

I've been learning about the powerful scripting language of mp3tag.

I have an example here

`$ifgreater($len(%title%),30,This title is too long!,)`

This basically adds "This title is too long!" to the %comment% tag if %title% is greater than 30 characters.

But where do we execute this script.

I also use the below in the export config

`$loop(%_path%)%genre% $loopend()`  
Can we use similar scriots to modify tags? If yes where do we execute it?

Thanks in advance and appreciate your patience

---

<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:** [May 14, 2023, 5:54am UTC](https://community.mp3tag.de/t/how-to-execute-a-script-in-mp3tag/60967/2 "2023-05-14T05:54:59Z")

</div>

> [@navarannan](#):
>
> export config
> 
> `$loop(%_path%)%genre% $loopend()`  
> Can we use similar scriots to modify tags? If yes where do we execute it?

Export scripts create external text files - so they do not change anything in the tags.

> [@navarannan](#):
>
> This basically adds "This title is too long!" to the %comment% tag if %title% is greater than 30 characters.

See the HowTo-FAQs on how to create a new action:

> [@Actions and batch-operations](https://community.mp3tag.de/t/actions-and-batch-operations/967/2):
>
> How to create a new action? First, create a new action group via Actions \> [Actions] Actions or Alt + 6. Then, click on the button [New] New and give your action group an expressive name, e.g., "All tag fields Upper Case". This action group can be applied to the selected files after you have added one or more actions to it. Now, you can create a new action in your action group via the button [New] New and choose the desired action type from the list. At the moment the following action types …

To assign a value to a field, use an action of the type "Format value", in this case for COMMENT:

Yet, I find it strange to write such a statement to a field - wouldn't it be a better step to filter for such files and then run an action or something to solve the problem? Because, I mean, what will you do with the information in the comment?

This filter would show you the files with longer titles:  
`"$ifgreater($len(%title%),30,yes,no)" IS yes`

---

<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:** [June 13, 2023, 5:55am UTC](https://community.mp3tag.de/t/how-to-execute-a-script-in-mp3tag/60967/3 "2023-06-13T05:55:03Z")

</div>

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