CD cover tool -- handling unusual symbols in folder names
Hello, I try to implement a script that will typeset covers for CD/DVD's that contain music compilations. Now I have script that follows. It scans the root directory of a CD for folders and outputs them a list. The major problem is that I have " & " and " ' " symbols in folder names on which script fails complaining (D:\context\xmldir-1.xml subject : - Music ! Argument of & has an extra }. <inserted text> \par <to be read again> } \next1 #1,->\dosetups {#1} \doprocesscommaitem \doprocesscommalist ...item \gobbleoneargument #1, ]\relax \global \advance \... \XML:ele:/file ->\setups [xmldir:file] \endgraf \egroup l.8 </file> ? ! Emergency stop. How can I cope with this? Best, Vyatcheslav %%%%%%%%%%%%%%%%%%%%%%%%%% \startmode[*first] \executesystemcommand {xmltools --dir --pattern=* --root=H:\ --output=xmldir-1.xml} \stopmode \setuppapersize [S6][S6] \setuplayout [width=middle, height=middle, backspace=12pt, topspace=12pt, bottomspace=32pt, header=0pt, footer=0pt, bottomdistance=9pt, bottom=18pt] \setupbackgrounds [text] [background=color, backgroundcolor=TextColor] \definecolor [TextColor] [r=.7,g=.8,b=.9] \definecolor [DoneColor] [s=.5] \setupcolors [state=start] \setuphead [subject] [style=\tfc] \setupbodyfont [ss] \defineXMLenvironment [files] [url=] {\doifelsenothing{\XMLop{url}} {\xdef\XMLDIRurl{}} {\xdef\XMLDIRurl{\XMLop{url}/}} \startXMLignore} {\stopXMLignore} \newcounter\NOfEntries \startsetups[xmldir:file] \doglobal\increment\NOfEntries {\hbox to \hsize \bgroup \XMLflush{base} \hss \hbox to 2em{\XMLflush{type}\hss} \quad \quad \hbox to 5em{\hss\XMLflush{size}} \quad \quad \XMLflush{date} \egroup} \stopsetups \defineXMLenvironment [directory] [name=] {\subject{Music}} {} \defineXMLenvironment [file] [name=] {\bgroup} {\setups[xmldir:file] \endgraf \egroup} \defineXMLsave[base] \defineXMLsave[type] \defineXMLsave[size] \defineXMLsave[date] \starttext \processXMLfilegrouped{xmldir-1.xml} \stoptext
participants (1)
-
Vyatcheslav Yatskovsky