Welcome Guest

Pages: 1
How to Export a Tag on a Per-File Basis
lvsassPostAugust 9, 2021, 07:26
Newbie
Posts: 4
Registered:
August 9, 2021, 11:13
Normal topicHow to Export a Tag on a Per-File Basis

Hi,

I'm trying to add a sub-action to a longer renaming/moving file action that is supposed to export the lyrics of each track of an album to a text file, with the filenames of text file and track matching.

I can't for the life of me figure out how to get Yate to process each track sequentially – I figure it has something to do with running in grouped mode, but I'm not getting the results I want. Currently, I have a sub-action that is run in grouped mode which contains:

    Test if the Lyrics field is not empty (Set result)
    if true
    Copy the Lyrics field if not empty to named variable 'Lyrics' only if empty
    Write Text File "./\!File Name (without extension)!.txt" from named variable 'Lyrics', encoding UTF-8
    endif

This results in one text file per track, but they all contain the first track's lyrics. How do I fix this?

2MR2PostAugust 9, 2021, 07:42
Avatar photo
Administrator
Posts: 2084
Registered:
August 23, 2012, 19:27
Normal topicHow to Export a Tag on a Per-File Basis

You almost have it. The issue seems to be with the following statement:

Copy the Lyrics field if not empty to named variable 'Lyrics' only if empty

Named variable 'Lyrics' is not empty after processing the first file. After the first file is processed the Lyrics named variable is not modified due to the trailing only if empty. The first 'not empty' is benign as you've already verified that it is not empty in your test. Replace the statement with the following:

Copy the Lyrics field to named variable 'Lyrics'

Force Grouped Execution as you have used it is fine and will always work. It is however not required as you can force it on the Run statement which calls the sub-action (by using the Grouped option). Forced Group Execution is always required if the action stared from the UI is to be run grouped. It is a good idea specify it on the Run statement so that it is more evident what is happening when you later look at the code. Leaving the Force Grouped Execution statement in will not hurt.

lvsassPostAugust 9, 2021, 07:51
Newbie
Posts: 4
Registered:
August 9, 2021, 11:13
Normal topicHow to Export a Tag on a Per-File Basis

Amazing, thanks for the quick reply!

Would have never guessed the only if empty would be the problem, but it does makes sense.

Pages: 1
Mingle Forum by Cartpauj | Version: 1.1.0beta | Page loaded in: 0.016 seconds.