Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: How to Use Functions (Read 719 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How to Use Functions

I am attempting to truncate all characters following "--" in the %title% metadata of my music files. I found an example of a function to perform this:

$puts(spacer,$strchr(%title%,"--"))$trim($left(%title%,$sub($get(spacer),1)))

However, I have no idea how to use this function. In Masstagger, when trying to use these functions in its "Set value..." or "Replace value..." options, it treats them as a literal string. How and where are these functions used? TIA

Re: How to Use Functions

Reply #1
- Select files - Properties - Right Click on Track Title - Automatically Fill... - put code in pattern
Edit: Hmm, disregard that, I thought it worked but it just changed it to filename  :-) I don't know then.
Edit2: You can set %title% as a source but it still does not work

Re: How to Use Functions

Reply #2
In the file properties window, click the Tools button and choose Automatically fill values. Use %title% as Source and %title%-- as Pattern.
I'm late

Re: How to Use Functions

Reply #3
@istarion
If you for some reason prefer Masstagger, use Format value from other fields...
Destination field name: TITLE
Formatting pattern:
Code: [Select]
$puts(spacer,$strstr(%title%,--))$trim($left(%title%,$sub($get(spacer),1)))
Note omitting the double quotation marks and the use of $strstr instead of $strchr, more info in Title Formatting Reference String functions.

(But I would use @davideleo's suggestion.)

Re: How to Use Functions

Reply #4
Excellent, thank you both! %title%-- did the trick. Very efficient code. So that I may better understand how this works, I was wondering if either of you could point me to where this syntax is explained? Now that I've cleared out all the old parts of my files' titles, I would like to rebuild them with %album% and %date%. Thanks again.