AIMP Forum

AIMP for Windows => Вопросы / Questions => Topic started by: xeo on October 29, 2019, 00:56:24

Title: Help creating templates with macros
Post by: xeo on October 29, 2019, 00:56:24
Hi, can anyone help me with creating template with macros that include Duration, Year, Genre for such conditions:

- only Duration in tags = Duration
- Duration + Year = Duration | Year
- Duration + Genre = Duration | Genre
- Duration + Year + Genre = Duration | Year | Genre
Title: Re: Help creating templates with macros
Post by: Artem on October 29, 2019, 08:28:55
Code: [Select]
%Duration%IF(%YEAR, | %YEAR,)%IF(%GENRE, | %GENRE,)
Title: Re: Help creating templates with macros
Post by: xeo on October 29, 2019, 13:24:36
Thank you.


What about this much harder with Artist, Title, Album:


no Artist, Title and Album = file name
Artist = Artist
Title = Title
Album = file name
Artist - Title = Artist - Title
Artist - Album = Artist - (no title) - Album
Artist - Title - Album = Artist - Title - Album
Title - Album = file name
Title: Re: Help creating templates with macros
Post by: Artem on October 29, 2019, 15:18:32
%IF(%Artist%Title%Album,<put something here>,%FileName)
Title: Re: Help creating templates with macros
Post by: xeo on October 29, 2019, 16:06:53
Not working very well. I created 8 files for all cases, each file named according to the tags included.
I tried %IF(%Artist%Title%Album,%Artist - %Title - %Album,%FileName)
Only 7 is good.
(https://i.imgur.com/7cC5dqj.png)

I also tried %IFEqual(%IF(%Artist,%Artist,%FileName),%IF(%Title,%Title,),%FileName,%IF(%Artist,%Artist - ,%FileName - )%Title - %Album)
and here 1, 4, 7 are ok.
(https://i.imgur.com/mNWcl51.png)
Title: Re: Help creating templates with macros
Post by: CkopoxoD on October 29, 2019, 19:27:49
Code: [Select]
%IF(%Artist,%Artist%IF(%Album, - %IF(%Title,%Title,(no title)) - %Album,%IF(%Title, - %Title,)),%IF(%Album,%FileName,%IF(%Title,%Title,%FileName)))
Title: Re: Help creating templates with macros
Post by: xeo on October 29, 2019, 22:08:16
Almost - 1, 3, 4, 5, 7 are ok  ;)

(https://i.imgur.com/25YXXy5.png)
Title: Re: Help creating templates with macros
Post by: CkopoxoD on October 30, 2019, 00:03:49
Oh, I forgot about empty title behavior... (%Title == %FileName)
Dirty workaround:
Code: [Select]
%IF(%Artist,%Artist%IF(%Album, - %IFEqual(%Title,%FileName,(no title),%Title) - %Album,%IFEqual(%Title,%FileName,, - %Title)),%IF(%Album,%FileName,%Title))but it will be incorrect if the title exists and matches the file name :(

Title - Album = file name
So 8 Ok?
Title: Re: Help creating templates with macros
Post by: JD on October 30, 2019, 13:32:24
Maybe just fill tags normally?
Title: Re: Help creating templates with macros
Post by: xeo on October 30, 2019, 17:28:19
You've done it. Everything is ok now. Thank you for your time.  :)
(https://i.imgur.com/GuadcFs.png)
Maybe just fill tags normally?
This is some kind of solution, but so far I don't have the strength to fix 8K files.
Title: Re: Help creating templates with macros
Post by: xeo on December 17, 2020, 02:12:52
Hi again, how can I completely remove Album info from this template?
%IF(%Artist,%Artist%IF(%Album, - %IFEqual(%Title,%FileName,%FileName,%Title) - %Album,%IFEqual(%Title,%FileName,, - %Title)),%IF(%Album,%FileName,%Title))
Title: Re: Help creating templates with macros
Post by: CkopoxoD on December 17, 2020, 16:16:50
Remove from template or from view?
Also, "%IFEqual(%Title,%FileName,%FileName,%Title)" is useless, the same as just %Title
Code: [Select]
%IF(%Artist,%Artist%IF(%Album, - %Title,%IFEqual(%Title,%FileName,, - %Title)),%IF(%Album,%FileName,%Title))
Title: Re: Help creating templates with macros
Post by: xeo on December 17, 2020, 23:03:08
Thanks, that's what I meant.