I'm exploring a feature of MP3tag - tools. So I would like to create a tool that goes to 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:
convert the artist to lowercase
remove leading "the+space"
get first character of artist
convert spaces within artist to "-"
create a URL (hyperlink)
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+,""),1)/$replace($regexp($lower(%artist%),^the\s+,""), ,-)-lyrics.html
The goal of this parameter is to create the following URL.
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.
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:
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.extThe space character is used to separate the items."P:\Program Files\test.exe" abc 123 filename.extIf 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" expectsrespectively 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
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.