Script to add suffix to album names

scripting
Tags: #<Tag:0x00007fde02f47f08>

#1

I can’t seem to get my head around scripting. Anyone who would help me figure out how to add a suffix like [file] to the end of every album I tag I would greatly appreciate it. Thank you!

I should clarify that I want it in the file tag not as part of a file renaming script.


#2

Hello,
as a reminder here is the documentation

for example:

syntax: $your_command(custom_name_command,$definition_command)
Methodology:
define your variables
make your fonctions
execute the script

Script example
$noop( If your music provide from; album, Add suffix [Album]; single, [Single] )
$noop( First define your suffixe, you can modify later if you want)

$set(_albumSuffixName,Albums/)
$set(_singlesSuffixName,Singles/)

$noop(detect if is Album or Single)
$noop( $condition(2nd condition(%command script from doc, function response), So make this with $set(YourCustomCommand,defOfyourCommand))
$noop( $if(insideOfMusicbrainzDatabaseContain(%ReleaseType%,album),$SoSet(_IsAlbum,True))
))

$noop(★ Detect Album ★)
$if($in(%releasetype%,album),$set(_isAlbum,1))

$noop(★ Detect Single ★)
$if($in(%releasetype%,single),  $set(_isSingle,1))
 
$noop( now that we have the possibility to detect if it is an album or a single, it must be used.)
$noop( $set(Mycommand,If(equal(%_isAlbum,return 1),so Mycommand is %_albumSuffixName%),
If(equal(_isSingle, return 1),so Mycommand is %_singlesSuffixName%))
)
$set(MycommandSuffix,$if($eq(%_isAlbum%,1),%_albumSuffixName%),
$if($eq(%_isSingle%,1),%_singlesSuffixNames%))
 
$noop(now, get the name)

%albumartist%/%album% %MycommandSuffix%/%tracknumber% - %title%

Output:
The Beatles/Sergent Peppers [Album]/4 Yellow Submarine.mp3
Eurythmics/Sweet Dreams [Single]/1 Sweet Dreams.flac

Dont forget:

Command OpenParenthesis Name, your command/function/Variable CloseParenthesis

$set(command,%titlte%)

Command OpenParenthesis Name, Conditions OpenParenthesis your condition, aswer CloseParenthesis your command/function/Variable CloseParenthesis CloseParenthesis

$if($in(%releasetype%,album),$set(_isAlbum,1))
$if($eq(%_isSingle%,1),%_singlesSuffixNames%))

Command OpenParenthesis yourCommand must is beetwen here CloseParenthesis

$noop(good syntax)
$if($in(%releasetype%,album),$set(_isAlbum,1))
$noop(Wrong syntax)
$noop(
     openopen condition close noaction close so set open album so 1 close ...It's a no sense)
$if($in(%releasetype%,album)),$set(_isAlbum,1)

Enjoy


#3

I’m not 100% sure I understand what you’re after, but I think this may do what you want. The script is actually quite simple:

$set(album,%album% [file])

The important thing is that the script needs to be in the Scripting section of your options rather than the File Naming section.

This will append the text “[file]” to the contents of the album tag for each file. If this isn’t what you wanted, please provide clarification and perhaps an example or two.


#4

Thank you both. The language of scripting is still lost on me. The variables throw me off but rdswift that scripting worked perfectly. Much appreciated.


#5

Thanks for letting us know that it worked for you. Glad I could help.