Hydrogenaudio Forums

Hosted Forums => foobar2000 => General - (fb2k) => Topic started by: Peter on 2008-05-19 00:06:49

Title: New component: Text Tools
Post by: Peter on 2008-05-19 00:06:49
Download: http://foobar2000.org/components (http://foobar2000.org/components)
Recommended for people who use the "copy names" command a lot. The Text Tools component lets you create multiple context menu commands copying information about the selected tracks using different title-formatting patterns. Additionally, the "advanced" dialog lets you produce a report with grouping and group headers/footers, for eg. exporting a list of your albums with full track lists.
Title: New component: Text Tools
Post by: ExUser on 2008-05-19 00:19:14
Excellent! Just what I've been hoping for! I love this component.
Title: New component: Text Tools
Post by: bb10 on 2008-05-19 00:24:55
Awesome! Thanks

Question: Is it possible to use this to get the total time of the selected tracks? Can't find a titleformatting function to do this.
Title: New component: Text Tools
Post by: foo_peter on 2008-05-19 01:04:53
I follow that....
but why twice the same one text Tools is already available?
and why never for exactly this function was created the  t %Total_length%

in the basis I do not understand it there it through to select in the status bar is already available

vllcht it can still be facilitated that my greatest wish would be
see text tools pic

sorry for my bad englisch

(http://img501.imageshack.us/img501/4666/screenshot1gd8.th.jpg) (http://img501.imageshack.us/my.php?image=screenshot1gd8.jpg)
Title: New component: Text Tools
Post by: saivert on 2008-05-19 01:13:57
foo_utils already provides a good Text tools Copy names functionality.

Quote
Provides various general purpose commands:
- Edit inactive playlists
- Sort by multiple fields
- Protect playlists against editing
- Cycle through playback orders
- Format text from track information and copy to clipboard or save to file
- Open foobar2000 profile and component directories in Explorer


Some of these features don't work anymore, so I guess that's why we now get a new text tools component.

Group header/footer item explanation
Group footer pattern is not the same as foo_utils's footer text, so a %total_length% title formatting item would be pointless here. Instead think of it as a footer to a block of text for each item.

Take this example where the field of the Text Tools Advanced dialog is filled in like this:

Track pattern: [%tracknumber%. ][%artist% - ]%title%
Group header pattern (checked): %list_index%: %path%
Group footer pattern (checked): Length: %length%$crlf()

This will yield the following result:
Quote
01: E:\music\diverse\video game music\chrono_cross.rar|Chrono Cross 115 Viper Manor.psf
Yasunori Mitsuda - 115 Viper Manor
Length: 3:04

02: E:\music\diverse\video game music\chrono_cross.rar|Chrono Cross 116 Victory - Spring's Gift.psf
Yasunori Mitsuda - 116 Victory - Spring's Gift
Length: 1:05

03: E:\music\diverse\video game music\chrono_cross.rar|Chrono Cross 117 Lost Child of Time.psf
Yasunori Mitsuda - 117 Lost Child of Time
Length: 3:33
Title: New component: Text Tools
Post by: foosion on 2008-05-19 07:47:06
The name and functionality clash with the text tools function from foo_utils is unfortunate and probably confusing; I have talked about this with Peter before he released foo_texttools. Since foo_texttools has support for presets and grouping, which foo_utils does not have, I am going to remove my text tools implementation from foo_utils in a future version. As far as I know, the remaining functionality that is only present in foo_utils - saving the formatted text directly using a menu command, larger scripts (or at least larger edit boxes) - is usually used to generate entire (HTML) documents. I plan to support that use case with a new component.
Title: New component: Text Tools
Post by: foo_peter on 2008-05-19 10:11:24
Hello foosion
Thanks for these words that lets me hope for years
and something would be advantage especially of several layouts
to manage

For that I make a request<A[request|application]> in the hope loves push



Thanks for all the effort<A[effort|trouble]> up to now and weiterso

sorry for my bad englisch
Title: New component: Text Tools
Post by: dubpistol on 2008-05-19 12:34:11
This is awesome. Thank you Peter
Title: New component: Text Tools
Post by: NullString on 2008-05-19 13:27:21
Thank you!
Title: New component: Text Tools
Post by: zmur on 2008-05-20 20:45:54
thanks
Title: New component: Text Tools
Post by: MuseFan on 2008-05-21 01:11:36
Cool!

Thanks Peter!
Title: New component: Text Tools
Post by: Olaf on 2008-06-24 10:58:21
I think I found a bug : if you assign a keyboard shortcut to a copy command, and then change the pattern of this command, the keyboard shortcut is broken (it says "Action Not Found (*lots of number and letters*)").

I have also a request : is it possible to have a multi-line editing field for the patterns ? I have some -very- long copy commands and it's not easy to modify them with one single line.

Anyway, thanks for this great component.
Title: New component: Text Tools
Post by: odyssey on 2008-06-24 17:07:10
It would be great if it was able to save the results directly as a textfile just like foo_utils
Title: New component: Text Tools
Post by: maxtail on 2008-06-25 02:04:50
Using previous version foo_utils with Copy Name function, I can do it by two steps only: Utils -> Copy Name.
Now using the new Text Tools component, I have to do it by three steps: Utils -> Text Tools -> Copy.
Is it possible to make it more simple? Thanks.
Title: New component: Text Tools
Post by: DocBeard on 2008-06-26 04:28:04
You can edit the context menu so that Text Tools is available from the root, in Preferences.
Title: New component: Text Tools
Post by: Fandango on 2008-08-04 23:31:12
I am going to remove my text tools implementation from foo_utils in a future version.

Any updates on that?
Title: New component: Text Tools
Post by: langoustator on 2009-01-06 15:42:19
Thanks for this useful plugin!
Small request: in the advanced window, would it be possible to remember the state of the Skip duplicate/repeating lines checkbox?
Title: New component: Text Tools
Post by: Yirkha on 2009-01-17 15:11:41
I think I found a bug : if you assign a keyboard shortcut to a copy command, and then change the pattern of this command, the keyboard shortcut is broken (it says "Action Not Found (*lots of number and letters*)").
A new version is up (http://www.foobar2000.org/?page=Download), with a fix for this misbehaviour.
Title: New component: Text Tools
Post by: Takaji on 2009-01-17 18:25:57
Thanks! I was looking for something like this.
Title: New component: Text Tools
Post by: Olaf on 2009-01-17 20:12:41
Thanks for the fix.
Title: New component: Text Tools
Post by: Hommit on 2009-01-31 13:17:24
Thanks for much useful plugin.

However, i have this annoying trouble: in Advanced window, the footer code don't save if i close foobar.
I have to store footer code in header area, which somewhat limiting my options...

also, it is posible to make template with all 3 fileds, so we don't have to go to advanced window all the time and copy by simply clicking menu option?
Title: New component: Text Tools
Post by: LePeR on 2010-01-12 06:18:53
Is it possible to be able to add brackets to my outputs? having no such luck unfortunately
Title: New component: Text Tools
Post by: bimbel on 2010-01-12 06:42:02
You need to escape brackets in title-formatting eg:

Code: [Select]
'('%artist%')'
Title: New component: Text Tools
Post by: LePeR on 2010-01-12 06:43:26
Ohh nice tyvm

Moderation: Removed unnecessary full quote of the preceding post.
Title: New component: Text Tools
Post by: garbanzo.bean on 2010-01-12 07:16:57
wow, very useful!

i too would like to see the ability to save advanced queries.

here is a code to output simple album listings. it's amazingly fast, even when processing 1000+ albums

Code: [Select]
Track Pattern:
%track% %title% ['['%track artist%']']

Group header pattern:
Artist: $if2(%album artist%,%artist%)$crlf()Album: %album%$crlf()Year: %date%$crlf()Quality: $ifequal($strcmp(%codec_profile%,CBR),1,%bitrate% ,)%codec_profile%$crlf()

Group footer pattern:
$crlf()


Result:

Artist: Blue Foundation
Album: Blue Foundation
Year: 2001
Quality: VBR V0

01 Wiseguy
02 Grand
03 Witch of Trouble
04 Crushed
05 Jabber
06 Hollywood
07 Burgeon
08 Black S
09 Mazda
10 Hide
11 Cutting Me Up
12 J.Hurt
13 Evo


Artist: Blue Foundation
Album: Sweep Of Days
Year: 2004
Quality: 320 CBR

01 History
02 As I Moved On
03 End Of The Day (Silence)
04 Ricochet
05 02.17 Am
06 Embers
07 Bonfires
08 The Yellow Man
09 Shine
10 Save This Town
11 Sweep
12 My Day
Title: New component: Text Tools
Post by: LePeR on 2010-01-12 07:39:30
That is actually amazingly useful

Moderation: Removed unnecessary full quote of the preceding post.
Title: New component: Text Tools
Post by: pyrotechnician on 2010-01-16 18:03:21
just the thing i was looking for.
thanks!
Title: New component: Text Tools
Post by: Rain on 2010-01-17 00:39:42
Thanks garbanzo.bean, that was really useful. Now I can copy album information a lot more easily
Title: New component: Text Tools
Post by: thecircusfreak on 2010-01-17 01:15:37
@ garbanzo.bean small notice,
the second part of this: $if2(%album artist%,%artist%) never gets evaluated,  there is no need (http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Title_Formatting_Reference#.25album_artist.25) for $if.
Title: New component: Text Tools
Post by: Rain on 2010-01-17 02:36:32
Slight edit of garbanzo.bean's code:

Code: [Select]
Track Pattern:
%track%. %title%[' ['%track artist%']']

Group header pattern:
$crlf()Artist: %album artist%$crlf()Album: %album%$crlf()Year: %date%$crlf()Quality: $ifequal($strcmp(%codec_profile%,CBR),1,%bitrate% ,)%codec_profile%$crlf()
Eliminates need for group footer pattern. Also removed first $if validation (not necessary).

Sample output:
Code: [Select]
Artist: U2
Album: How To Dismantle An Atomic Bomb
Year: 2004
Quality: VBR V4

01. Vertigo
02. Miracle Drug
03. Sometimes You Can't Make It On Your Own
04. Love And Peace Or Else
05. City Of Blinding Lights
06. All Because Of You
07. A Man And A Woman
08. Crumbs From Your Table
09. One Step Closer
10. Original Of The Species
11. Yahweh
12. Fast Cars
Title: New component: Text Tools
Post by: garbanzo.bean on 2010-01-17 12:46:54
@ thecircusfreak - can you explain why? i put it there because i only add album artist if two or more tracks have different artists. otherwise the tag is empty. if %album artist% is empty, does foobar automatically look for %artist%?

@ Rain - thanks for tidying things up
Title: New component: Text Tools
Post by: TomBarlow on 2010-01-17 13:05:57
if %album artist% is empty, does foobar automatically look for %artist%?

Yes, and it looks for composer then performer as well if artist is empty.
Title: New component: Text Tools
Post by: Keesface on 2010-01-19 18:05:42
i use this for copying the content of my entire library (just albums:)

Track List:
Code: [Select]
'['%date%']'%album% // $ifequal($strcmp(%codec_profile%,CBR),1,%bitrate% ,)%codec_profile%

Group Header:
Code: [Select]
%album artist%

This will result in a list like this:
Code: [Select]
Audioslave
[2002]Audioslave // VBR V0
[2005]Out Of Exile // VBR V0
[2006]Revelations // VBR V0

Autechre
[1993]Incunabula // VBR V0
[1994]Amber // VBR V0
[2001]Confield // VBR V0
[2003]Draft 7.30 // VBR V0

Autumn's Grey Solace
[2006]Shades Of Grey // VBR V0

Band Of Horses
[2006]Everything All The Time // VBR V0
[2007]Cease To Begin // VBR V2
Title: New component: Text Tools
Post by: stefle on 2010-01-23 21:48:58
Found a strange behaviour:
%list_index% is not treated the same in «Quick Copy Commands» (i.e. presets) and «Advanced...»  when called up from within a playlist. IMO the Advanced settings do better.
Title: New component: Text Tools
Post by: fuffi on 2011-01-01 13:37:20
Hi Peter,
very useful plugin, thank you.
also thanks to garbanzo.bean & Rain for their code. helpful!

i too would like to see the ability to save advanced queries.

me to :-)

for the quick copy command i'd like to know, if its possible to have all information in one single line (without crlf, space instead).

i mostly copy tracktitles to the clipboard and then want to paste them into a search field of a website in an internet-browser.
that searchfield, of course, needs the search-query in a single line.
so i need to copy the text to notepad, remove the line breaks by hand ...

this might be a "let the user change the separator" feature request if this isnt possible :-)

anybody an idea, on how i could accomplish this?
Title: New component: Text Tools
Post by: Anakunda on 2011-12-10 20:21:49
HI!

If I'm not mistaken this is the only etension for fb2k having reporting capabilities. It would be very useful to extend it for more than one level of grouping, ie. allow one group for global header and it's closing footer (no grouping capabilities), then on lower level a custom header/closing footer for %album artist% / %album% group, and on another level a custom header/closing footer for [%discnumber%] (if present). If discnumber not present, this header/footer wouldnot be inserted. On lovest level individual tracks. Also the closing footer wouldnot have grouping capabilities, ie. it would just close the related header on the same level (if inserted)

So I'd like the global header could contain any user defined text, header on album level could be this:

Artist: %album artist%
Album: %album%
Release date: $if2(%releasedate%,%date%)
Genre: %genre%
Total tracks: %totaltracks%
...

header on Disc level could be

Disc %discnumber%

It would be also very useful to enable on each level define set of grouping tags, ie. enable not to handle all tags used in header text as unique group.
Title: New component: Text Tools
Post by: vogliadicane on 2011-12-11 11:21:19
Made some more generic script concerning Codec, Album Artist/Track Artist and Total Disc Info (based on garbanzo.bean's/Rain's code):

Code: [Select]
Group header pattern:

$crlf()%album artist%/%album%$ifgreater(%totaldiscs%,1, - CD %discnumber%,)/%date% '('%codec%[ %codec_profile%$ifequal($strcmp(%codec_profile%,CBR),1, %bitrate% kbps,)]')'$crlf()

Track pattern:

%track%  $if($meta(album artist),%artist%: ,)%title% - %length%

results in:

Code: [Select]
Air/Premiers Symptomes/1999 (MP3 CBR 128 kbps)

01  Modular Mix - 6:00
02  Casanova 70 - 5:54
03  Les Professionnels - 4:33
04  J'Ai Dormi Sous l'Eau - 5:42
05  Le Soleil Est Pres de Moi - 4:52
06  Californie - 2:28
07  Brakes On - 4:23


The Hellacopters/Payin' The Dues/1999 (FLAC)

01  You Are Nothin' - 2:39
02  Like No Other Man - 3:15
03  Looking At Me - 2:04
04  Riot On The Rocks - 1:23
05  Hey! - 3:21
06  Soulseller - 3:13
07  Where The Action Is - 2:41
08  Twist Action - 2:04
09  Colapso Nervioso - 4:04
10  Psyched Out And Furious - 4:14


LTJ Bukem/Progression Sessions 003/2000 (MP3 VBR V2)

01  Control: Control - 8:07
02  Big Bud: Pure - 7:00
03  Big Bud: State Of Mind - 7:03
04  Future Engineers: Time Shift - 6:39
05  Voyager: Apollo - 4:52
06  Second Vision: Italian Job - 6:15
07  Blu Mar Ten: Santur - 6:00
08  Big Bud: Transmission - 7:23
09  Intense: Solar - 7:30
10  Big Bud: Emotionography (Remix) - 6:49
11  Blu Mar Ten: B.R.O. - 7:29


120 Days/120 Days - CD 1/2006 (MP3 VBR V2)

01  Come Out (Come Down, Fade Out, Be Gone) - 8:51
02  Be Mine - 4:15
03  C-Musik - 7:22
04  Sleepwalking - 3:28
05  Get Away - 4:41
06  Keep on Smiling - 5:30
07  Lazy Eyes - 4:40
08  Sleepless Nights #3 - 3:04
09  I've Lost My Vision (Kraut nr1) - 11:26


120 days/120 days - CD 2/2006 (MP3 VBR V2)

01  120 days / Sleepwalking 120 days Remix - 8:00
02  120 days / Come Out, Come Down, Fade Out, Be Gone (T.A.Kaukolampi remix) - 9:33
03  Come Out, Come Down, Fade Out, Be Gone (Reconstructed by Secret Machines) - 6:07
04  120 days / Come Out, Come Down, Fade Out, Be Gone (Mental Overdrive remix) - 9:14

Title: New component: Text Tools
Post by: Anakunda on 2011-12-11 12:00:19
Yes that's right I can do this with Text Tools, but much more I liked the report in following format.
Demonstrate it on a playlist of one 1disc album and one 2disc album.

This is what I get with Text Tools actually:

Code: [Select]
The BEATLES/Rubber Soul (2009 Mono Remaster)/1965 (TAK 4 max)

01. Drive My Car                                                      [2:34]
...
28. Run for Your Life (stereo)                                        [2:22]

The BEATLES/White Album (2009 Mono Remaster) - CD 1/1968 (TAK 4 max)

01. Back In The U.S.S.R.                                              [2:44]
...
17. Julia                                                             [2:54]

The BEATLES/White Album (2009 Mono Remaster) - CD 2/1968 (TAK 4 max)

18. Birthday                                                          [2:43]
...
30. Good Night                                                        [3:13]


And this is what I have asked for in my previous post, ie. more hiarerchic grouping:

Code: [Select]
[size=16px][b]Tracklist:[/b][/size]

[size=14px][b]The BEATLES/Rubber Soul (2009 Mono Remaster)/1965 (TAK 4 max)[/b]

[font=Courier]01. Drive My Car                                                      [2:34]
...
28. Run for Your Life (stereo)                                        [2:22][/font]

[b]The BEATLES/White Album (2009 Mono Remaster)/1968 (TAK 4 max)[/b]

[b]Disc 1:[/b]
[font=Courier]01. Back In The U.S.S.R.                                              [2:44]
...
17. Julia                                                             [2:54][/font]

[b]Disc 2:[/b]
[font=Courier]18. Birthday                                                          [2:43]
...
30. Good Night                                                        [3:13][/font][/size]
Title: New component: Text Tools
Post by: vogliadicane on 2011-12-11 16:06:05
^^ jfi my post was NOT a reply to your request
Title: New component: Text Tools
Post by: Anakunda on 2011-12-11 16:11:10
Too bad. Anyone else can fullfill my request?
Title: New component: Text Tools
Post by: vogliadicane on 2011-12-11 18:29:30
nice puzzle, here you go (adjust the line breaks to your liking):

Code: [Select]
Group header:
$ifgreater(%totaldiscs%,1,$ifgreater(%discnumber%,1,,$crlf()%album artist%/%album%/%date% '('%codec%[ %codec_profile%$ifequal($strcmp(%codec_profile%,CBR),1, %bitrate% kbps,)]')'$crlf()),$crlf()%album artist%/%album%/%date% '('%codec%[ %codec_profile%$ifequal($strcmp(%codec_profile%,CBR),1, %bitrate% kbps,)]')'$crlf())$ifgreater(%totaldiscs%,1,$crlf()disc %discnumber%,)

gives for a multi disc album:

Code: [Select]
120 Days/120 Days/2006 (MP3 VBR V2)

disc 1
01  Come Out (Come Down, Fade Out, Be Gone) - 8:51
02  Be Mine - 4:15
03  C-Musik - 7:22
04  Sleepwalking - 3:28
05  Get Away - 4:41
06  Keep on Smiling - 5:30
07  Lazy Eyes - 4:40
08  Sleepless Nights #3 - 3:04
09  I've Lost My Vision (Kraut nr1) - 11:26

disc 2
01  120 days / Sleepwalking 120 days Remix - 8:00
02  120 days / Come Out, Come Down, Fade Out, Be Gone (T.A.Kaukolampi remix) - 9:33
03  Come Out, Come Down, Fade Out, Be Gone (Reconstructed by Secret Machines) - 6:07
04  120 days / Come Out, Come Down, Fade Out, Be Gone (Mental Overdrive remix) - 9:14

and for all others the usual output

Code: [Select]
Johnny Cash/American IV: The Man Comes Around/2002 (MP3 VBR V2)

01  The Man Comes Around - 4:27
02  Hurt - 3:39
03  Give My Love To Rose - 3:29
04  Bridge Over Troubled Water - 3:55
Title: New component: Text Tools
Post by: mjm716 on 2013-08-08 22:49:43
I'm bumping this thread to see if anyone has a technique for splitting the output into multiple files and saving each file to a unique path.

For example:

I use text tools to create a master file with a basic XML format such as:

<file>
<path>directory path/filename</path>

album info

</file>
...

I would now like to split the info between <file></file> and save each block as the address in <path>

any tips?
Title: New component: Text Tools
Post by: Robertina on 2013-08-09 00:30:56
I would now like to split the info between <file></file>

Chopping List (http://skwire.dcmembers.com/fp/?page=chopping-list) (don't let the software's name annoy you) is capable of "splitting the content of text files into multiple new files based on a user-provided delimiter."

Quote
and save each block as the address in <path>

Not possible with that software.
Title: New component: Text Tools
Post by: mjm716 on 2013-08-09 11:54:14
Not possible with that software.


I'm aware it is not directly possible - I'm just wondering if any of the great minds here might have an idea on how to achieve this (win7).

Splitting the file is not so difficult - it is saving the pieces to correct directories that I'm stuck on.

Also the general format is completely flexible - I could write out anything to fit a solution.
Title: Re: New component: Text Tools
Post by: MordredKLB on 2016-05-17 20:16:53
Really wish this component would be updated. It's super useful, but it's got some serious bugs and missing features. There was a legacy Text Tools add-on that I've been using for probably 6 years now, went to install it on a new foobar install and found this one instead. I decided to copy over my formatting scripts and found some problems with it.

Bugs/Improvements needed:

If the source code for this plugin were available I'd happily update it. But starting from scratch seems a little daunting, especially for such a rarely used plugin.
Title: Re: New component: Text Tools
Post by: tanjidoor on 2016-11-28 06:44:45
Bump. Please consider what MordredKLB said, this tool is quite lacking compared to the old foo_utils one.
Title: Re: New component: Text Tools
Post by: tipar on 2018-07-15 01:30:31
Would it be possible to copy the text and then send it to the search bar automatically, in facets for instance?
SimplePortal 1.0.0 RC1 © 2008-2019