I've tried using your code and modifying it without any luck I keep getting scripting errors.
I've used this script:
$regexp($trim(%unsyncedlyrics%),^(...||)\s*(.+)\s*$,$1[TITLE - ARTIST:%title% - %artist%\n\n\n]$2[\n\n\n\nAUTHOR:%author%])
I get this:
XXX||ARTIST: Matt Monroe
TITLE: There's A Place For Us
*there is no "author" at the end of the song. I'm trying to add at the end of the lyrics "MUSIC from Joe" as the author. Maybe and error in the script?
I would prefer "ARTIST:" & "TITLE:" not be visible within the field.
I want it to look like this:
"There's A Place For Us"
by Matt Monroe
(adding the word "by" in the script of the artist name)
and at the end of the of the song lyrics with x3 enter/return spaces:
"MUSIC from Joe"
I would appreciate more of your input and advice on how to get this done this way
Thank you in advance
Name of action group: _Script Test#TEST
Action type: Format value
Formatstring: $regexp($trim(%unsyncedlyrics%),^(...||)\s*(.+)\s*$,$1[TITLE - ARTIST:\t\t%title% - %artist%\n\n\n]$2[\n\n\n\nAUTHOR:\t\t%author%])
This will do three things.
- Trim trailing and leading whitespace from the original UNSYNCEDLYRICS field to clean it up.
- Append the artist - title to the start with 2 linefeeds only if them two fields exist.
- Append the author to the end with 3 linefeeds if only that field exists.
Start would be like: Notice the leading and trailing whitespaces marked *
I've omitted the xxx|| for clarity
Result: with white pace cleaned up and the text formatted with tabbed title - artist and aurtor
TITLE - ARTIST: mytitlegoeshere - artistnamegoeshere
Let me know if you want to retain the tabs otherwise just remove the \t from the code.
I personally would spilt the artist on line 1 and title on line two. Like