Wednesday, 29 May 2013

Ah, Another

This CD list is different in so far as it comes from the burn list .axp file and contains no information on timings. The information on timings comes from the presence of the music audio files and this is what enables the CD cover to be printed to .PDF and it is from that .PDF that the list with timings in brackets is derived. That will always be the main list I use, and I made a variation based on that for any CD burning rather than one for a Sunday service.

With an .axp file available it is always possible to make a simple list even if the music files are not available. Incidentally, an .axp file is another one of these HTML lookalike files using .XML, the same that works for music composition and overlays when editing .PDF files directly. This is because XML uses custom tags.

I made a clip that worked and used a pre-set wizard that needed a simple OK. I've kept that (as it offers variations) but have incorporated external help into the body of a second .axp to .txt clip, AXP to TXT (nt shorter), and it now looks like:

^!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

^!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

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

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

;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
^!InsertFile ^%EditList^%Index%%
^!GoTo LOOP2

^!Replace "^\x20+" >> "" WARS
^!Replace "(?s)^.+?title=(\x22\x22)\x20artist=\1>\R" >> "" WRS
^!Replace "^> "" WARS
^!Replace "\.wav.+$" >> "" WARS
^!Replace "(?s)\R
> "" WRS
; Number lines
^!SetWordWrap OFF
^!Set %Ln%=^$GetTextLineCount$

^!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

 The automatic clip "Sorting numbers zeros" is used (see a previous entry) because the wizard did leading zeros and this alone doesn't. I also have a front end to all the above as follows:


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


^!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"

No comments: