# Tool Trouble. How to preview tool output?

**URL:** <https://community.mp3tag.de/t/tool-trouble-how-to-preview-tool-output/15640>\
**Category:** Support\
**Created:** [April 9, 2014, 11:23pm UTC](https://community.mp3tag.de/t/tool-trouble-how-to-preview-tool-output/15640 "2014-04-09T23:23:11Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![nhtrader](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/n/b9e5f3/32.png) [@nhtrader](https://community.mp3tag.de/u/nhtrader)\
**Post date:** [April 9, 2014, 11:23pm UTC](https://community.mp3tag.de/t/tool-trouble-how-to-preview-tool-output/15640/1 "2014-04-09T23:23:11Z")

</div>

v2.58

I'm exploring a feature of MP3tag - tools. So I would like to create a tool that goes to [www.elyrics.net](http://www.elyrics.net) and show me the list of songs from an artist (lyrics that are available)

So I need to accomplish the following tasks:

1. convert the artist to lowercase
2. remove leading "the+space"
3. get first character of artist
4. convert spaces within artist to "-"
5. create a URL (hyperlink)
6. use the web browser of my choice to fetch the webpage and display it.

With these tasks in mind I did the following:  
Selected Menu FILE|OPTIONS|TOOLS (left column)|right side clicked icon NEW  
NAME: opera-elyrics-artist  
PATH:C:\Program Files\Opera\opera.exe  
PARAMETER: [http://www.elyrics.net/song/$left($regexp($lower(%artist%),^the\s+,](http://www.elyrics.net/song/%24left(%24regexp(%24lower(%25artist%25),%5Ethe%5Cs+,)""),1)/$replace($regexp($lower(%artist%),^the\s+,""), ,-)-lyrics.html

The goal of this parameter is to create the following URL.

```
http://www.elyrics.net/song/m/marshall-tucker-band-lyrics.html

```

But the value of %artist% = "The Marshall Tucker Band"

Of course this attempt at using my new tool failed to create the desired URL. The website produced a 404 ERROR (Page Not Found).

My questions are...

1. Is there a way to preview any of the results of any of the elements that I constructed in my parameter?
2. Can I create a tool to send the output to Notepad (or some other text viewer) for debugging purposes?
3. What did I do wrong in constructing the PARAMETER? I'm not seeing syntax error.

---

<div class="post-metadata">

**Author:** ![poster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/poster/32/4881_2.png) [@poster](https://community.mp3tag.de/u/poster)\
**Post date:** [April 10, 2014, 4:23am UTC](https://community.mp3tag.de/t/tool-trouble-how-to-preview-tool-output/15640/2 "2014-04-10T04:23:30Z")

</div>

> [@nhtrader](#):
>
> 1. Is there a way to preview any of the results of any of the elements that I constructed in my parameter?

Yes. You can use the coverter Tag-Tag to see a preview of your format string.

---

<div class="post-metadata">

**Author:** ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)\
**Post date:** [April 10, 2014, 9:18am UTC](https://community.mp3tag.de/t/tool-trouble-how-to-preview-tool-output/15640/3 "2014-04-10T09:18:08Z")

</div>

> [@nhtrader](#):
>
> ... I would like to create a tool that goes to [www.elyrics.net](http://www.elyrics.net) and show me the list of songs from an artist (lyrics that are available) ...  
> The goal of this parameter is to create the following URL.
> 
> ```
> http://www.elyrics.net/song/m/marshall-tucker-band-lyrics.html
> 
> ```
> 
> But the value of %artist% = "The Marshall Tucker Band"  
> ... 3. What did I do wrong in constructing the PARAMETER? ...

Some examples ...

**Wikipedia Album '"http://www.google.de/search?q=site%3Awikipedia.org+'$regexp($regexp($regexp($lower($trim(%ALBUM%)),'[^a-z 0-9]',),'\b(?:and|und)\b',),'\s+','+')'"' Wikipedia Artist '"http://www.google.de/search?q=site%3Awikipedia.org+'$regexp($regexp($regexp($lower($trim(%ARTIST%)),'[^a-z 0-9]',),'\b(?:and|und)\b',),'\s+','+')'"' Google Artist '"http://www.google.com/search?as\_q='$replace(%ARTIST%,' ','+','&','%26','?','%3F')'&as\_qdr=all&num=20"' Google Images '"http://www.google.com/images?as\_q='$replace(%ARTIST%' '%TITLE%,' ','+','&','%26','?','%3F')'"' Google Lyrics '"http://www.google.de/search?as\_q='$replace(%ARTIST%' '%TITLE%' Lyrics',' ','+','&','%26','?','%3F')'&as\_qdr=all&num=20"' GermanCharts '"http://germancharts.com/search.asp?cat=s&artist='%ARTIST%'&artist\_search=starts&title='%TITLE%'&title\_search=starts"' elyrics.net '"http://www.elyrics.net/song/'$regexp(%ARTIST%,'^(?:The)?\s\*(.).+?\s\*$','\L$1')'/'$regexp($regexp(%ARTIST%,'^(?:The)?\s\*(.+?)\s\*$','\L$1'),'\s','-')'-lyrics.html"' ... or ... '"http://www.elyrics.net/song/'$regexp($regexp(%ARTIST%'###'%ARTIST%,'^(?:The)?\s\*(.).+?\s\*###(?:The)?\s\*(.+?)\s\*$','\L$1/$2'),'\s','-')'-lyrics.html"'**

DD.20140410.1318.CEST

---

<div class="post-metadata">

**Author:** ![ryerman](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ryerman/32/5285_2.png) [@ryerman](https://community.mp3tag.de/u/ryerman)\
**Post date:** [April 10, 2014, 10:50am UTC](https://community.mp3tag.de/t/tool-trouble-how-to-preview-tool-output/15640/4 "2014-04-10T10:50:37Z")

</div>

> [@nhtrader](#):
>
> 1. Can I create a tool to send the output to Notepad (or some other text viewer) for debugging purposes?

Create a .BAT file with this line:

```
echo %1 | clip

```

Use the path to the .BAT file.  
The parameter is the format string and the results will be written to the clipboard, which you can paste in Notepad.

> [@nhtrader](#):
>
> 1. What did I do wrong in constructing the PARAMETER? I'm not seeing syntax error.

The double quotes cause the problem.  
Try this:  
PARAMETER: [http://www.elyrics.net/song/$left($regexp($lower(%artist%),^the\s+,](http://www.elyrics.net/song/$left($regexp($lower(%25artist%25),%5Ethe%5Cs+,)),1)/$replace($regexp($lower(%artist%),^the\s+,), ,-)-lyrics.html

---

<div class="post-metadata">

**Author:** ![nhtrader](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/n/b9e5f3/32.png) [@nhtrader](https://community.mp3tag.de/u/nhtrader)\
**Post date:** [April 10, 2014, 2:38pm UTC](https://community.mp3tag.de/t/tool-trouble-how-to-preview-tool-output/15640/5 "2014-04-10T14:38:09Z")

</div>

> [@poster](#):
>
> Yes. You can use the coverter Tag-Tag to see a preview of your format string.

Thank you. This answers my question regarding how to preview the construction of a complicated script.

For the benefit of others, I did the following:  
Selected MENU CONVERT| Tag-Tag  
Field: COMMENT (I chose this tag to prevent overwriting existing data)  
Format String: (I copied and pasted my script into this box)  
And instantly below it displays the output. I didn't even have to click the PREVIEW button.

Fantastic.  
Question Answered.

---

<div class="post-metadata">

**Author:** ![nhtrader](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/n/b9e5f3/32.png) [@nhtrader](https://community.mp3tag.de/u/nhtrader)\
**Post date:** [April 10, 2014, 2:59pm UTC](https://community.mp3tag.de/t/tool-trouble-how-to-preview-tool-output/15640/6 "2014-04-10T14:59:31Z")

</div>

DetLevD Kudos. Thank for the examples. I see the error of my ways.  
Problem solved.

For the benefit of others, this is how I corrected my script and it works in a tool.

```
'"http://www.elyrics.net/song/'$left($regexp($lower(%artist%),'^the\s+','$1'),1)'/'$replace($regexp($lower(%artist%),'^the\s+','$1'), ,-)'-lyrics.html"'

```

Of course, I could have used the example provided verbatum (elegant coding), but I'm learning how to create tools. So I tinkered with my original script and got it to work as expected.

Lastly, I'd like to learn more. Where can I find more information regarding the syntax because I have another tool script that works without double-encapsulating it within ' " ..... " ' and without encapsulating the function. Here it is:

```
https://en.wikipedia.org/w/index.php?search=$replace(%artist%, ,+)

```

So of course I tried to execute the elyrics script without encapsulation and it failed. So I'm unclear as to when encapsulation is required.

---

<div class="post-metadata">

**Author:** ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)\
**Post date:** [April 10, 2014, 4:09pm UTC](https://community.mp3tag.de/t/tool-trouble-how-to-preview-tool-output/15640/7 "2014-04-10T16:09:42Z")

</div>

> [@nhtrader](#):
>
> ... Where can I find more information regarding the syntax because I have another tool script that works without double-encapsulating it within ' " ..... " ' and without encapsulating the function. ...

**Just in a nutshell! 1. Rules for the system command line: In general a commandline (without optional switches) is structured like ... "P:\Program Files\test.exe" abc 123 filename.ext The space character is used to separate the items. "P:\Program Files\test.exe" abc 123 filename.ext If one parameter contains one or more space characters, then the parameter string has to be enclosed into double quotes. "P:\Program Files\test.exe" "a b c" 123 "file name.ext" ==\> (three parameters) "P:\Program Files\test.exe" "a b c 123 file name.ext" ==\> (one parameter) "P:\Program Files\test.exe" a b c 123 file name.ext ==\> (six parameters) 2. Rules for the Mp3tag Tools feature: The Mp3tag "Options/Tools" edit field "parameters" expects respectively accepts a Mp3tag format string, which should create a valid commandline for the called program. '"'%ARTIST%'" '$num(%TRACK%,3)' "'%\_filename\_ext%'"' param1 param2 param3 '"'%ARTIST%' '$num(%TRACK%,3)' '%\_filename\_ext%'"' param1**

> [@nhtrader](#):
>
> '"[http://www.elyrics.net/song/'$left($regexp($lower(%artist%),'^the\s+','$1'),1)'/'$replace($regexp($lower(%artist%),'^the\s+','$1](http://www.elyrics.net/song/'$left($regexp($lower(%25artist%25),'%5Ethe%5Cs+','$1'),1)'/'$replace($regexp($lower(%25artist%25),'%5Ethe%5Cs+','$1)'), ,-)'-lyrics.html"'

This is quirky regexp syntax ... because there is no $1 group referenced in the regular expression, the $1 referrer is empty resp. does not exist, therefore you can leave the replacement part of the regexp empty.

**'"http://www.elyrics.net/song/'$left($regexp($lower(%ARTIST%),'^the\s+',),1)'/'$replace($regexp($lower(%ARTIST%),'^the\s+',),' ','-')'-lyrics.html"'**

DD.20140410.2009.CEST

---

<div class="post-metadata">

**Author:** ![nhtrader](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/n/b9e5f3/32.png) [@nhtrader](https://community.mp3tag.de/u/nhtrader)\
**Post date:** [April 10, 2014, 7:40pm UTC](https://community.mp3tag.de/t/tool-trouble-how-to-preview-tool-output/15640/8 "2014-04-10T19:40:38Z")

</div>

> [@DetlevD](#):
>
> **Just in a nutshell! 1. Rules for the system command line: In general a commandline (without optional switches) is structured like ... "P:\Program Files\test.exe" abc 123 filename.ext The space character is used to separate the items. "P:\Program Files\test.exe" abc 123 filename.ext If one parameter contains one or more space characters, then the parameter string has to be enclosed into double quotes. "P:\Program Files\test.exe" "a b c" 123 "file name.ext" ==\> (three parameters) "P:\Program Files\test.exe" "a b c 123 file name.ext" ==\> (one parameter) "P:\Program Files\test.exe" a b c 123 file name.ext ==\> (six parameters) 2. Rules for the Mp3tag Tools feature: The Mp3tag "Options/Tools" edit field "parameters" expects respectively accepts a Mp3tag format string, which should create a valid commandline for the called program. '"'%ARTIST%'" '$num(%TRACK%,3)' "'%\_filename\_ext%'"' param1 param2 param3 '"'%ARTIST%' '$num(%TRACK%,3)' '%\_filename\_ext%'"' param1**

Thank you for sharing these rules and your help. I'm very excited to explore this powerful feature. This is going to be fun.

One last question, is there a character limit to the length of the PARAMETER?

> [@](#):
>
> This is quirky regexp syntax ... because there is no $1 group referenced in the regular expression, the $1 referrer is empty resp. does not exist, therefore you can leave the replacement part of the regexp empty.
> 
> **'"http://www.elyrics.net/song/'$left($regexp($lower(%ARTIST%),'^the\s+',),1)'/'$replace($regexp($lower(%ARTIST%),'^the\s+',),' ','-')'-lyrics.html"'**
> 
> DD.20140410.2009.CEST

I'm glad you brought it up. I thought it was strange. But when I looked at the examples I saw that they were used. So I used them too.

BTW, here is an improved script which accounts for Artists that begin with a digit (0-9):  
'"[http://www.elyrics.net/song/'$if($isdigit($left($regexp($lower(%artist%),'^the\s+',),1)),'0-9',$left($regexp($lower(%artist%),'^the\s+',),1))'/'$replace($regexp($lower(%artist%),'^the\s+](http://www.elyrics.net/song/'$if($isdigit($left($regexp($lower(%25artist%25),'%5Ethe%5Cs+',),1)),'0-9',$left($regexp($lower(%25artist%25),'%5Ethe%5Cs+',),1))'/'$replace($regexp($lower(%25artist%25),'%5Ethe%5Cs+)',), ,-)'-lyrics.html"'

---

<div class="post-metadata">

**Author:** ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)\
**Post date:** [April 11, 2014, 5:14pm UTC](https://community.mp3tag.de/t/tool-trouble-how-to-preview-tool-output/15640/9 "2014-04-11T17:14:33Z")

</div>

> [@nhtrader](#):
>
> ... One last question, is there a character limit to the length of the PARAMETER? ...

There is a MS article with old wisdoms about the command-line string limitation.  
So we should hope, and rely on, that Florian has also reserved enough space.  
(english) [https://support.microsoft.com/en-us/kb/830473](https://support.microsoft.com/en-us/kb/830473)  
(german) [https://support.microsoft.com/de-de/kb/830473](https://support.microsoft.com/de-de/kb/830473)

DD.20140411.2114.CEST

---

<div class="post-metadata">

**Author:** ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)\
**Post date:** [February 9, 2026, 12:24pm UTC](https://community.mp3tag.de/t/tool-trouble-how-to-preview-tool-output/15640/10 "2026-02-09T12:24:59Z")

</div>

Closed on February 9, 2026, 12:24pm UTC


