Welcome Guest

Pages: 1 2 3
Request: import titles from text file
ratmicePostJune 26, 2015, 10:54
Beginner
Posts: 25
Registered:
December 23, 2014, 21:35
Hot topicRe: Request: import titles from text file

Quote from 2MR2 on May 31, 2015, 10:18
Yate can read, write and parse any text file.

I've taken you literally and posted an action here:

http://2manyrobots.com/actions/ImportTitlesFromTextFile.zip

It's a little overkill but what the heck. Unzip the file and drag the 'Import Titles from Test File.plist' file to Yate's main window file list area. You should then have an action named: Import Titles from Test File

The action prompts for a text file, removes all blank lines from the content and applies the titles to the selected files (in the order listed in the main window). The action validates that the number of contained titles is the same as the number of selected files. I'm assuming that the file selection lists the files in the correct order. You can always drag and drop them to change the order. Note that the action does not save the files so you're not committed. You can always revert the changes if you're not happy.

If you want something more visual, the upcoming v3.7 will support prompting/editing of multi-line text as opposed to a single line. This will enable the changing of the action to present the list of titles which you could then rearrange.

So I've been using this for a while and it works great except for one little issue. It appears to validate the number of titles with the total number of files in the main YATE window, rather than the number of selected files in that view. I took a look at the script and, to be honest, it's totally incomprehensible to this coding illiterate. Any way to get the behavior I'm looking for, which is to label only the selected (highlighted) files?

edit: I was looking at the plist file rather than using the actions manager (rookie mistake). It makes much more sense now 😉 I'll dig into it a bit to see if I can get it to work on the selected, rather than the total, files.

Just to be clear, if I drag 3 albums/discs, let's say with 10 songs each, into the main window. If I select one of them (10 songs) and use the script I get an error that says there are 10 titles and 30 files and it will not complete.

-Ratmice

2MR2PostJune 26, 2015, 15:12
Avatar photo
Administrator
Posts: 2083
Registered:
August 23, 2012, 19:27
Hot topicRe: Request: import titles from text file

All Yate actions only work on the selected files. I've just tried the action here with 2 of 10 files selected and it worked as expected. Are you sure you don't have All Files enabled for the Action in the Action Manager. If All Files is enabled, all loaded files are preselected when the action starts. You will see that the files are actually selected when the action ends.

ratmicePostJune 26, 2015, 15:14
Beginner
Posts: 25
Registered:
December 23, 2014, 21:35
Hot topicRe: Request: import titles from text file

thank you, indeed that option is checked. Again thanks.

tommyjiangPostFebruary 3, 2020, 05:01
Newbie
Posts: 7
Registered:
December 28, 2019, 21:06
Hot topicRe: Request: import titles from text file

This action cannot be imported in the new version (5.1.0.1).

Same question. I have the text from Clipboard or files. like

01. XXXX
02. XXXX

Thanks.

Quote from 2MR2 on May 31, 2015, 10:18
Yate can read, write and parse any text file.

I've taken you literally and posted an action here:

http://2manyrobots.com/actions/ImportTitlesFromTextFile.zip

It's a little overkill but what the heck. Unzip the file and drag the 'Import Titles from Test File.plist' file to Yate's main window file list area. You should then have an action named: Import Titles from Test File

The action prompts for a text file, removes all blank lines from the content and applies the titles to the selected files (in the order listed in the main window). The action validates that the number of contained titles is the same as the number of selected files. I'm assuming that the file selection lists the files in the correct order. You can always drag and drop them to change the order. Note that the action does not save the files so you're not committed. You can always revert the changes if you're not happy.

If you want something more visual, the upcoming v3.7 will support prompting/editing of multi-line text as opposed to a single line. This will enable the changing of the action to present the list of titles which you could then rearrange.

2MR2PostFebruary 3, 2020, 09:03
Avatar photo
Administrator
Posts: 2083
Registered:
August 23, 2012, 19:27
Hot topicRe: Request: import titles from text file

Yah, that action is below the cut off date for supported earlier versions. A generalized more powerful version of the action was released back in early 2019. You can get it off the resources page or here:

https://2manyrobots.com/YateResources/docs/GenericTextFileImporter.html

Your requirements are a simplistic case. In Preferences - File to Tag construct a simple template which looks like the attached image. If you wish you can download the template here:

https://2manyrobots.com/actions/Track.Title.zip

Load and select all the files to be modified by the text file. Run the Generic Text File Importer action and follow the instructions. When prompted for the File to Tag template select the one you created or downloaded.

Image

tommyjiangPostFebruary 3, 2020, 15:53
Newbie
Posts: 7
Registered:
December 28, 2019, 21:06
Hot topicRe: Request: import titles from text file

Yes, But if multi-line from clipboard,only first line can be read. my text like:

01, AAAA
02, BBBB
03, CCCC

Quote from 2MR2 on February 3, 2020, 09:03
Yah, that action is below the cut off date for supported earlier versions. A generalized more powerful version of the action was released back in early 2019. You can get it off the resources page or here:

https://2manyrobots.com/YateResources/docs/GenericTextFileImporter.html

Your requirements are a simplistic case. In Preferences - File to Tag construct a simple template which looks like the attached image. If you wish you can download the template here:

https://2manyrobots.com/actions/Track.Title.zip

Load and select all the files to be modified by the text file. Run the Generic Text File Importer action and follow the instructions. When prompted for the File to Tag template select the one you created or downloaded.

Image

Image

2MR2PostFebruary 3, 2020, 16:53
Avatar photo
Administrator
Posts: 2083
Registered:
August 23, 2012, 19:27
Hot topicRe: Request: import titles from text file

You've written an action to read the contents of the clipboard and then to pass it through a File to Tag template. This is not what I described. Also you are evidently now using a comma (,) as a delimiter as opposed to a period (.) which you specified in your last email. I will make changes to the Generic Text File Importer action to support the clipboard as well. The File to Tag action statement is designed to work on a single file. The Generic Text File Importer action does extra work to handle the multiple lines and files. I'll get back to you with a variant which handles the clipboard as well as files.

2MR2PostFebruary 3, 2020, 20:20
Avatar photo
Administrator
Posts: 2083
Registered:
August 23, 2012, 19:27
Hot topicRe: Request: import titles from text file

I've updated the Generic Text File Importer. Actually it has been renamed to Generic Text Importer. There are now two variants. One which loads the metadata from a text file and one which takes the metadata from the system clipboard.

The new actions remember the last used File to Tag template. The download also includes a new FTT template which will support a track number followed by a space, comma or period, followed by a title. Unless you choose a different template, this will be used as the initial choice.

If you have the data as described in your clipboard content screenshot the new Generic Text Import (Clipboard) action will do what you want.

tommyjiangPostFebruary 4, 2020, 05:59
Newbie
Posts: 7
Registered:
December 28, 2019, 21:06
Hot topicRe: Request: import titles from text file

OK, Thanks. 😀

Where can find this action?

Quote from 2MR2 on February 3, 2020, 20:20
I've updated the Generic Text File Importer. Actually it has been renamed to Generic Text Importer. There are now two variants. One which loads the metadata from a text file and one which takes the metadata from the system clipboard.

The new actions remember the last used File to Tag template. The download also includes a new FTT template which will support a track number followed by a space, comma or period, followed by a title. Unless you choose a different template, this will be used as the initial choice.

If you have the data as described in your clipboard content screenshot the new Generic Text Import (Clipboard) action will do what you want.

2MR2PostFebruary 4, 2020, 07:30
Avatar photo
Administrator
Posts: 2083
Registered:
August 23, 2012, 19:27
Hot topicRe: Request: import titles from text file

Yate has a web resources page. You can link directly to the resources page from Yate's Help menu. The actions are currently at the top of the list in the Sample Actions section.

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