= V7 MultiLine NoSorting TabWidth=20

H=";Files"

H="XML open all"
^!ClearVariable %FileList%
^!Set %Folder%=^?{(T=D)Full path=C:\Shared Documents\Dropbox\Public\Pluralist\Spiritual\}
^!Set %FullPath%=^$GetFileFirst(^%Folder%;*.*xml*)$

:Loop
^!IfTrue ^$IsEmpty(^%FullPath%)$ Close
^!Append %FileList%=^%FullPath%^%nl%
^!Open "^%FullPath%"
^!Set %FullPath%=^$GetFileNext$
^!GoTo Loop

:Close
^!CloseFileFind
^!Info [L]^%FileList%

H="XML open one"
^!Save AS C:\Shared Documents\Dropbox\Public\Pluralist\Spiritual\temp.tmp

^!SetWizardLabel Press OK for AXPs here or navigate
^!Set %Folder%=^?{(T=D)&Browse: Confirm OK or press the button=^$GetValue(DirStuff:Browse)$}

^!StatusShow Finding files...
^!SetScreenUpdate Off

^!Set %Type%=*.xml
^!Set %Sort%=Name

^!FocusDoc
^!Close DISCARD
^!DestroyDoc C:\Shared Documents\Dropbox\Public\Pluralist\Spiritual\temp.tmp

^!Set %FullPath%=^$GetFileFirst(^%Folder%;"^%Type%";^%Sort%)$
; Checks to see if files are found by search criteria
^!IfTrue ^$IsEmpty("^%FullPath%")$ END

:LOOP1
^!IfTrue ^$IsEmpty(^%FullPath%)$ DOARRAY
^!Append %Files%=^%FullPath%|
^!Set %FullPath%=^$GetFileNext$
^!Goto LOOP1

:DOARRAY

^!CloseFileFind
^!SetArray %EditList%=^?{(T=L;H=16)Choose=^%Files%}
^!Set %Count%=^%EditList0%
^!Set %Index%=0

:LOOP2
;When it chooses a file the index position forces it out of the loop
^!Set %FilePathFull%=^%EditList^%Index%%
^!Inc %Index%
^!If ^%Index% > ^%Count% END
^!Toolbar New Document
^!FocusDoc
^!InsertFile ^%EditList^%Index%%
^!GoTo LOOP2

:END

H="AXP open all"
^!ClearVariable %FileList%
^!Set %Folder%=^?{(T=D)Full path=C:\Shared Documents\Music\}
^!Set %FullPath%=^$GetFileFirst(^%Folder%;*.*axp*)$

:Loop
^!IfTrue ^$IsEmpty(^%FullPath%)$ Close
^!Append %FileList%=^%FullPath%^%nl%
^!Open "^%FullPath%"
^!Set %FullPath%=^$GetFileNext$
^!GoTo Loop

:Close
^!CloseFileFind
^!Info [L]^%FileList%

H="MusicXML verses extract"
^!Set %working%=^$GetDocName$
^!Set %FileName%=^?{Give the new document a new working name=_HL ^$GetName(^%working%)$|SF ^$GetName(^%working%)$|HW ^$GetName(^$GetDocName$)$|LS ^$GetName(^$GetDocName$)$}
^!Set %Type%=.txt

^!Toolbar Copy All
^!Toolbar New Document
^!Toolbar Paste
^!FocusDoc

^!Jump Doc_Start

^!Set %LyricCounter%="1"

:GatherLoop
^!Set %LyricEnd%="^%LyricCounter%"

;long line follows
^!Set %Lyrics^%LyricCounter%%="^$GetDocListAll(" *\<lyric number\="^%LyricCounter%"\>\r\n *\<syllabic\>(.*?)\</syllabic\>\r\n *\<text\>(.*?)\</text\>\r\n *\</lyric\>";"$1|$2;")$"
;long line precedes
^!If "^%Lyrics^%LyricCounter%%" = "" Process
^!Inc %LyricCounter%
^!Goto GatherLoop

:Process
^!Set %LyricCounter%="1"
^!Select All

:ProcessLoop
^!If "^%LyricCounter%" = "^%LyricEnd%" FinishIt
^!InsertText Lyrics ^%LyricCounter%: ^%Lyrics^%LyricCounter%%^P
^!Inc %LyricCounter%
^!Goto ProcessLoop

:FinishIt
^!Replace "^(\d+\x20)(.+)\R\1(.+)$" >> "$1$2\x20$3" WARS

^!Jump Doc_Start
^!Replace ";begin|" >> " " WAS

^!Jump Doc_Start
^!Replace "begin|" >> "" WAS

^!Jump Doc_Start
^!Replace ";middle|" >> "-" WAS

^!Jump Doc_Start
^!Replace ";end|" >> "-" WAS

^!Jump Doc_Start
^!Replace ";single|" >> " " WAS

^!Jump Doc_Start
^!Replace "single|" >> "" WAS

^!Jump Doc_Start
^!Replace "&apos;" >> "'" WAS

^!Jump Doc_Start
^!Replace "Lyrics " >> "^P" WAS

^!Jump Doc_Start
^!InsertText ^%FileName%
^!InsertText ^P

^!Jump Doc_Start
^!Replace ";^P" >> "^P" WAS

^!Jump Doc_Start
^!Replace "-" >> "" WAS

^!Save AS "C:\Adrian's Documents\Music\^%FileName%^%Type%"

H=";"

H=";Text Extraction"

H="MusicXML extract thorough"
^!Continue Extracts Titles and Lyrics. Proceed with a MusicXML file open.
^!SetScreenUpdate Off
^!Replace "&apos;" >> "'" WAS
^!Replace "\R(?=</text>)" >> "" WARS
^!Find "(?s)^\x20*<credit page="1">.+</credit>" WRS
^!Set %Credits%=^$GetSelection$
^!Set %Credits%=^$StrReplace("<[^>]+>";"";^%Credits%;AR)$
^!Set %Credits%=^$StrReplace("^\x20+";"";^%Credits%;AR)$
^!Set %Credits%=^$StrReplace("^\R";"";^%Credits%;AR)$
^!Replace "\x20(?=</text>)" >> "" WARS
^!Replace "<syllabic>(?:single|end)\X+?<text>[^<]+?\K(?=</text>)" >> "\x20" WARS
^!SetClipboard ^$GetDocListAll("^\x20*<lyric number="(\d+)\X+?<text>([^<]+?)</text>";$1|$2\r\n)$
^!Select All
^!Paste
^!Set %Nr%=1

:Loop
^!Set %Text%=^$GetDocListAll("^^%Nr%\|(.+)";"$1")$
^!IfEmpty ^%Text% Out
^!Append %All%=^%Text%^P^P
^!Inc %Nr%
^!Goto Loop

:Out
^!Select All
^!InsertText ^%All%
^!Replace "(?<=[,;.\x20])\x20?(?=[[:upper:]])" >> "\r\n" WARS
^!Jump Doc_Start
^!InsertText ^%Credits%^P
^!Jump Doc_Start
^!Set %FileName%=^$GetLine$
^!Save as "C:\Adrian's Documents\Music\^%FileName%.txt"
^!ClearVariables

H=";"

H=";Audio CD Listing"

H="Music Order service"
^!ClearVariables
^!Toolbar New Document

^!Set %Preacher%=^?[Click on the Service Taker's name=Adrian Worsfold|Barry Cundill|Bernard McHugh|Chris Pilkington|David Arthur|Elizabeth Faiers|Ernest Baker|Jim Timiney|John Midgley|John Williams|June Pettitt|Brinley Price|Keith Brown|Marion Baker|Mavis Lake|Michael Tracey|_Ralph Catts|Rosemary Arthur|Stephanie Bisby|Stephen Carlile]

^!Info [L]"Print the CD Cover to PDF and copy the tracks.^PAlso note the total time of tracks before the first hymn^P(wipe out first hymn onward - do not save!)."

^!ShellWait "C:\Program Files\CDBurnerXP\cdbxpp.exe"

^!SetScreenUpdate Off

^!InsertHTML ^P^P

^!Set %Date%=^$GetDateFromInt(^$Calc(CEIL((^$GetDateToInt$+6)/7)*7-6)$;yyyymmdd)$
^!Set %Filename%="Service ^%Date%"

^!Toolbar New Document

^!Set %Trackslist1%=^$Getclipboard$
^!InsertText ^%Trackslist1%

^!Jump Doc_Start

^!SetHintInfo Working...
^!SetScreenUpdate Off
; Remove spaces at start or end of lines
^!Replace "^\x20+|\x20+$" >> "" WARS
; Make new line break
^!Replace "\R(?![1-9])" >> "\x20" WARS
; Remove new space at EOF
^!Replace "\x20+\Z" >> "" WRS
^!Jump Doc_Start
:Seconds
^!Find "(\d\d)\.\d$" RS
^!IfError Skip_2
^!InsertText "^$Calc(^$GetReSubstrings$+1)$"
^!Goto Seconds
^!Jump Doc_Start
:Minutes_1
^!Find "([0][1-8]):60$" RS
^!IfError Skip_2
^!InsertText "0^$Calc(^$GetReSubStrings$+1)$:00"
^!Goto Minutes_1
^!Jump Doc_Start
:Minutes_2
^!Find "([0][1-9]):60$" RS
^!IfError Skip_2
^!InsertText "^$Calc(^$GetReSubStrings$+1)$:00"
^!Goto Minutes_2
^!Jump Doc_Start
:Minutes_3
^!Find "(\d\d):60$" RS
^!IfError Out
^!InsertText "^$Calc(^$GetReSubStrings$+1)$:00"
^!Goto Minutes_3
:Out
^!Replace ":\K(?=\d$)" >> "0" WARS
; Embrace time with square brackets / Remove '00' hours
^!Replace "00:(\d\d:\d\d)$" >> "[$1]" WARS
^!Jump 1
^!Clip "Brackets square end"

^!Clip "Sorting numbers zeros"

;Hymn books gaps
^!Replace "^.*\b(HL|SF|LS|CC|HW|HF|NB)\b.*$" >> "\r\n$0\r\n" WARS
^!Replace "\R{3}" >> "\r\n" WARS
^!Replace "^\A\R|\R{1,}\Z" >> "" WARS

^!Select All
^!Set %Trackslist2%=^$GetSelection$

^!DestroyDoc

^!FocusDoc

;Removes last lines if blank
^!Replace "\R{1,}\Z" >> "" WRS

^!Jump Doc_Start

^!Set %Minutes%=^?{Minutes Long (two digits)=20}
^!Set %Seconds%=^?{Seconds Long (two digits)=00}
^!Set %Minsclock%=^$Calc(60-^%Minutes%)$
^!InsertText "^P^PService ^%Date%^P^P^%Preacher%^P^P^P<Start 10:^%Minsclock% for 11:00 start [^%Minutes%:^%Seconds%]>^P^P"

^!InsertText ^%Trackslist2%

^!Save As "C:\Users\Worsfold\Music\^%Filename%.txt"

H="Music Order any CD"
^!ClearVariables
^!Toolbar New Document

^!Set %Owner%=^?[Click on the CD owner's name=_Adrian Worsfold|Mick Taylor|Mike Peachey]

^!Info [L]"Get the length, print the CD Cover to PDF, copy the tracks."

^!ShellWait "C:\Program Files\CDBurnerXP\cdbxpp.exe"

^!SetScreenUpdate Off

^!InsertHTML ^P^P

^!Set %Date%=^$GetDate(yyyymmdd)$

^!Set %Filename%="CD made ^%Date%"

^!Toolbar New Document

^!Set %Trackslist1%=^$Getclipboard$
^!InsertText ^%Trackslist1%

^!Jump Doc_Start

^!SetHintInfo Working...
^!SetScreenUpdate Off
; Remove spaces at start or end of lines
^!Replace "^\x20+|\x20+$" >> "" WARS
; Make new line break
^!Replace "\R(?![1-9])" >> "\x20" WARS
; Remove new space at EOF
^!Replace "\x20+\Z" >> "" WRS
^!Jump Doc_Start
:Seconds
^!Find "(\d\d)\.\d$" RS
^!IfError Skip_2
^!InsertText "^$Calc(^$GetReSubstrings$+1)$"
^!Goto Seconds
^!Jump Doc_Start
:Minutes_1
^!Find "([0][1-8]):60$" RS
^!IfError Skip_2
^!InsertText "0^$Calc(^$GetReSubStrings$+1)$:00"
^!Goto Minutes_1
^!Jump Doc_Start
:Minutes_2
^!Find "([0][1-9]):60$" RS
^!IfError Skip_2
^!InsertText "^$Calc(^$GetReSubStrings$+1)$:00"
^!Goto Minutes_2
^!Jump Doc_Start
:Minutes_3
^!Find "(\d\d):60$" RS
^!IfError Out
^!InsertText "^$Calc(^$GetReSubStrings$+1)$:00"
^!Goto Minutes_3
:Out
^!Replace ":\K(?=\d$)" >> "0" WARS
; Embrace time with square brackets / Remove '00' hours
^!Replace "00:(\d\d:\d\d)$" >> "[$1]" WARS
^!Jump 1
^!Clip "Brackets square end"

^!Clip "Sorting numbers zeros"

^!Select All
^!Set %Trackslist2%=^$GetSelection$

^!DestroyDoc

^!FocusDoc

;Removes last lines if blank
^!Replace "\R{1,}\Z" >> "" WRS

^!Jump Doc_Start

^!Set %Minutes%=^?{Minutes Long (two digits)=70}
^!Set %Seconds%=^?{Seconds Long (two digits)=00}
^!InsertText "^P^P^%Owner%'s Audio CD^P^PMade ^%Date%^P^PCD length ^%Minutes% minutes and ^%Seconds% seconds^P^P"

^!InsertText ^%Trackslist2%

^!Save As "C:\Users\Worsfold\Music\^%Filename%.txt"

H=";"

H=";Preparation"

H="Music Order preacher next"
^!Info Copy sent hymns and music order sent by email and save these prior to arrangement and CD burning.

^!Set %Preacher%=^?{(T=L;H=16)Click on a name=Adrian Worsfold^=WorsfoldAdrian|Stephen Carlile^=CarlileStephen|Chris Pilkington^=PilkingtonChris|Ernest Baker^=BakerErnest|Rosemary Arthur^=ArthurRosemary|David Arthur^=ArthurDavid|Bernard McHugh^=McHughBernard|Barry Cundill^=CundillBarry|Mavis Lake^=LakeMavis|John Williams^=WilliamsJohn|Jim Timiney^=TimineyJim|Keith Brown^=BrownKeith|June Pettitt^=PettittJune|Michael Tracey^=TraceyMichael|Elizabeth Faiers^=FaiersElizabeth|Marion BakerBaker^=Marion|Stephanie Cage^=CageStephanie|John Midgley^=MidgleyJohn}

^!Shellwait "D:\Programs\DreamMail\DM2005.exe"

^!Set %Date%=^$GetDateFromInt(^$Calc(CEIL((^$GetDateToInt$+6)/7)*7-6)$;yyyymmdd)$

^!Jump Doc_Start
^!InsertText ^%Preacher% ^%Date%
^!InsertHTML ^P^P

^$Getclipboard$

^!Save As "C:\Shared Documents\Music\^%Preacher% Music Hymns ^%Date%.txt"

H="Music Simple List"
^!Close ALL
^!Save AS C:\Shared Documents\Music\temp.tmp

^!SetWizardLabel Press OK for AXPs here or navigate
^!Set %Folder%=^?{(T=D)&Browse: Confirm OK or press the button=^$GetValue(DirStuff:Browse)$}

^!StatusShow Finding files...
^!SetScreenUpdate Off

^!Set %Type%=*.axp
^!Set %Sort%=Name

^!FocusDoc
^!Close DISCARD
^!DestroyDoc C:\Shared Documents\Music\temp.tmp

^!Set %FullPath%=^$GetFileFirst(^%Folder%;"^%Type%";^%Sort%)$
; Checks to see if files are found by search criteria
^!IfTrue ^$IsEmpty("^%FullPath%")$ END

:LOOP1
^!IfTrue ^$IsEmpty(^%FullPath%)$ DOARRAY
^!Append %Files%=^%FullPath%|
^!Set %FullPath%=^$GetFileNext$
^!Goto LOOP1

:DOARRAY

^!CloseFileFind
^!SetArray %EditList%=^?{(T=L;H=16)Choose=^%Files%}
^!Set %Count%=^%EditList0%
^!Set %Index%=0

:LOOP2
;When it chooses a file the index position forces it out of the loop
^!Set %FilePathFull%=^%EditList^%Index%%
^!Inc %Index%
^!If ^%Index% > ^%Count% PROCEED
^!Toolbar New Document
^!FocusDoc
^!InsertFile ^%EditList^%Index%%
^!GoTo LOOP2

:PROCEED

^!Clip "AXP to TXT (nt shorter)"

^!Jump DOC_START

^!Set %Preacher%=^?{(T=L;H=18)Click on the Service Taker's or CD Owner's name=Adrian Worsfold|Barry Cundill|Bernard McHugh|Chris Pilkington|David Arthur|Elizabeth Faiers|Ernest Baker|Jim Timiney|John Midgley|John Williams|June Pettitt|Keith Brown|Marion Baker|Mavis Lake|Michael Tracey|Rosemary Arthur|Stephanie Cage|Stephen Carlile}

^!Set %Date%=^$GetDateFromInt(^$Calc(CEIL((^$GetDateToInt$+6)/7)*7-6)$;yyyymmdd)$

^!SetWizardLabel Date and CDs this date Options
^!Set %CDDate%=^?{(T=L;H=8)Date of CD=_Next Sunday^=^%Date%|Today^=^$GetDate(yyyymmdd)$}; %AddNum%=^?{Number?=_Only one^=only|First this date^=01|Second this date^=02|Third this date^=03|Fourth this date^=04|Fifth this date^=05}

^!Set %Filename%="Simple List ^%CDDate% ^%AddNum%"

^!InsertText ^%Preacher%'s CD on ^%CDDate%^P^P

^!Save As "C:\Shared Documents\Music\^%Filename%.txt"

H=";"

H=";Useful Tasks"

H="SurnameFirstname to usual"
^!Replace "\b([A-Z][a-z]+)((?1))\b" >> "$2\x20$1:" WARS

H="Timings whole seconds"
^!Replace "\x20{1,}$" >> "" WARS

^!SetHintInfo Working...
^!SetScreenUpdate Off
^!Jump Doc_Start
:Seconds
^!Find "(\d\d)\.\d$" RS
^!IfError Skip_2
^!InsertText "^$Calc(^$GetReSubstrings$+1)$"
^!Goto Seconds
^!Jump Doc_Start
:Minutes_1
^!Find "([0][1-8]):60$" RS
^!IfError Skip_2
^!InsertText "0^$Calc(^$GetReSubStrings$+1)$:00"
^!Goto Minutes_1
^!Jump Doc_Start
:Minutes_2
^!Find "([0][1-9]):60$" RS
^!IfError Skip_2
^!InsertText "^$Calc(^$GetReSubStrings$+1)$:00"
^!Goto Minutes_2
^!Jump Doc_Start
:Minutes_3
^!Jump Doc_Start
^!Find "(\d\d):60$" RS
^!IfError Out
^!InsertText "^$Calc(^$GetReSubStrings$+1)$:00"
^!Goto Minutes_3
:Out
^!Replace ":\K(?=\d$)" >> "0" WARS

H="Brackets square end"
^!Replace "\x20{1,}$" >> "" WARS

^!Replace "(\d\d:\d\d)$" >> "[$0]" WARS

H="Merge sections"
^!SetHintInfo Working...
^!SetScreenUpdate Off
; Remove spaces at start or end of lines
^!Replace "^\x20+|\x20+$" >> "" WARS
; Make new line break
^!Replace "\R(?![1-9])" >> "\x20" WARS
; Remove new space at EOF
^!Replace "\x20+\Z" >> "" WRS
^!Jump Doc_Start
:Seconds
^!Find "(\d\d)\.\d$" RS
^!IfError Skip_2
^!InsertText "^$Calc(^$GetReSubstrings$+1)$"
^!Goto Seconds
^!Jump Doc_Start
:Minutes_1
^!Find "([0][1-8]):60$" RS
^!IfError Skip_2
^!InsertText "0^$Calc(^$GetReSubStrings$+1)$:00"
^!Goto Minutes_1
^!Jump Doc_Start
:Minutes_2
^!Find "([0][1-9]):60$" RS
^!IfError Skip_2
^!InsertText "^$Calc(^$GetReSubStrings$+1)$:00"
^!Goto Minutes_2
^!Jump Doc_Start
:Minutes_3
^!Jump Doc_Start
^!Find "(\d\d):60$" RS
^!IfError Out
^!InsertText "^$Calc(^$GetReSubStrings$+1)$:00"
^!Goto Minutes_3
:Out
^!Replace ":\K(?=\d$)" >> "0" WARS
; Embrace time with square brackets / Remove '00' hours
^!Replace "00:(\d\d:\d\d)$" >> "[$1]" WARS
^!Jump 1

H="Sorting numbers zeros"
^!SetHintInfo Working...
^!SetScreenUpdate Off
^!Set %dig%=2
^!Find "^\d{^%dig%}" WRS
^!IfError Skip_2
^!Inc %dig%
^!Goto Skip_-3
^!Dec %dig%
^!Set %q%=^$Calc(^%dig%-1)$
^!Replace "^" >> "^$StrFill(\x30;^%dig%)$" WARS
^!Replace "^\x30+?(.{^%q%}\d\b)" >> "$1" WARS
^!Select All
^$StrSort("^$GetSelection$";0;1;0)$

H="Brackets square end position"
^!Continue Must place on first line of timings to bracket them.
^!ClearVariables
^!Set %Pos%=^$GetTextLineCount$
^!Set %Lines%=^$GetParaRow$
^!Set %Bracket%=^$Calc(^%Pos%-^%Lines%)$

:LOOP
^!Inc %Count%
^!Jump LINE_END
^!InsertText "]"
^!MoveCursor -006
^!InsertText "["
^!Jump LINE_START
^!Jump +001
^!IfError END
^!If ^%Count% > ^%Bracket% END
^!GoTo LOOP

:END

H="Hymns music arrangements"
^!Replace "^.*\b(HL|SF|LS|CC|HW|HF|NB)\b.*$" >> "\r\n$0\r\n" WARS
^!Replace "\R{3}" >> "\r\n" WARS
^!Replace "^\A\R|\R{1,}\Z" >> "" WARS

H="Tracklists recall"
^!InsertText ^%Trackslist1%
^!InsertText ^P^P
^!InsertText ^%Trackslist2%

H="Procession"
 <procession>

H="Meditation"
 <meditation>

H="Listen"
 <listen>

H="Collection"
 <collection>

H="Prelude"
 <Prelude>

H="Postlude"
 <Postlude>

H="Others involved"
 - music with Daniella Fountain and Tony Ward

H="Music Order online"
 https://dl.dropboxusercontent.com/u/28120070/Pluralist/spiritual/musicorder.pdf for the long list of music in services including this one.

H="Copy Music Order online"
^!CopyClip "Music Order online"

H="Hymns available online"
 https://dl.dropboxusercontent.com/u/28120070/Pluralist/spiritual/hymnsavailable.html for the hymns and their presentation.

H="Copy Hymns available online"
^!CopyClip "Hymns available online"

H=";"

H=";Alternatives"

H="AXP to TXT (no timings)"
^!Clearvariables
^!SetWordWrap OFF
; Remove spaces at start or end of lines
^!Replace "^\x20+|\x20+$" >> "" WARS
^!Replace "\x20{1,}$" >> "" WARS
^!Jump Doc_Start
^!Find "artist="">"
^!Set %Lines%=^$Calc(^$GetParaRow$-1)$
^!Jump Doc_Start

:LOOP
^!Inc %Count%
^!DeleteLine
^!If ^%Count% > ^%Lines% FRED
^!GoTo LOOP

:FRED

^!Replace "<track path="C:\Shared Documents\Music\Service\" >> "" WAS
^!Replace ".wav" title="" artist="" number="" >> "" WAS
^!Replace "</compilation>^P</layout>" >> "" WAS

^!Set %Linesleft%=^$GetParaRow$

:LOOPY
^!Inc %Number%
^!If ^%Number% > ^%Linesleft% BOB
^!Jump Doc_Start
^!Replace "^%Number%" />" >> "" S
^!GoTo LOOPY

:BOB

^!Clip "lines number"

;Hymn books gaps
^!Replace "^.*\b(HL|SF|LS|CC|HW|HF|NB)\b.*$" >> "\r\n$0\r\n" WARS
^!Replace "\R{3}" >> "\r\n" WARS
^!Replace "^\A\R|\R{1,}\Z" >> "" WARS

^!SetWordwrap ON

H="AXP to TXT (nt shorter)"
^!Clearvariables
^!Replace "^\x20+" >> "" WARS
^!Replace "(?s)^.+?title=(\x22\x22)\x20artist=\1>\R" >> "" WRS
^!Replace "^<track.+?Service\\" >> "" WARS
^!Replace "\.wav.+$" >> "" WARS
^!Replace "(?s)\R</compilation.+" >> "" WRS
; Number lines
^!SetWordWrap OFF
^!Set %Ln%=^$GetTextLineCount$
:Loop
^!Jump ^%Ln%
^!InsertText ^%Ln%^%Space%
^!Dec %Ln%
^!If ^%Ln% > 0 ^!Goto Loop

^!Clip "Sorting numbers zeros"

;Hymn books gaps
^!Replace "^.*\b(HL|SF|LS|CC|HW|HF|NB)\b.*$" >> "\r\n$0\r\n" WARS
^!Replace "\R{3}" >> "\r\n" WARS
^!Replace "^\A\R|\R{1,}\Z" >> "" WARS

^!SetWordwrap ON

H=";"

H=";Services lists to All Services"

H="Music List All"
:ReStart
^!ClearVariables

^!Set %Folder%=^?{Can alter=_E:\Music\Services lists\^=E:\Music\Services lists\|^$GetValue(DirStuff:Path1)$|^$GetValue(DirStuff:Path2)$|^$GetValue(DirStuff:Path3)$|^$GetValue(DirStuff:Path4)$|^$GetValue(DirStuff:Path5)$|^$GetValue(DirStuff:Path6)$|^$GetValue(DirStuff:Path7)$|^$GetValue(DirStuff:Path8)$|^$GetValue(DirStuff:Path9)$}; %Type%=^?{(H=10)File &Types, wildcards OK: *.txt or *.*htm*;*.txt=All Files^=*.*|Html Only^=*.*htm*|_Text Only^=*.txt|Html & Text^=*.*htm*;*.txt|Outline^=*.otl|Clipbook Library^=*.clb|Ini^=*.ini}; %All%=^?{Filename for all appended files= All Services.txt}; %Sort%=^?{Sorting method=Unsorted|_Name|Type|Date|Size}; %Rev%=^?{Reverse sorting=_No^=|Yes^=Rev}; %Divide%=^%nl%^%nl%^%nl%^?{Add separator=* Next Service Follows *}^%nl%^%nl%

^!SetHintInfo Working...
^!SetScreenUpdate Off

; Gets the first filename in the folder
^!Set %FullPath%=^$GetFileFirst(^%Folder%;"^%Type%";^%Rev%^%Sort%)$
; Checks to see if files are found by search criteria
^!IfTrue ^$IsEmpty("^%FullPath%")$ Error

:Loop2
^!IfTrue ^$IsEmpty(^%FullPath%)$ Info
^!AppendToFile "^%Folder%^%All%" ^$GetFileText(^%FullPath%)$^%Divide%
^!Set %FullPath%=^$GetFileNext$
^!Goto Loop2

:Info
^!CloseFileFind
^!StatusShow Files done!
^!Delay 10
^!StatusClose
^!Open "^%Folder%^%All%"
^!Save As "C:\Users\Worsfold\Music\All Services.txt"
^!Open "^%Folder%^%All%"
^!DestroyDoc "^%Folder%^%All%"

^!Goto End

:Error
^!Skip There were no files by the file type you search for (^%Type%) in ^%Folder%. Try again?
^!Goto End
^!Goto ReStart