Answer the question
In order to leave comments, you need to log in
Bat how to generate xml?
Font search works very poorly in nexus font, it cannot find it recursively, even if you set the appropriate directory in the configuration file, so you need to generate xml like:
<?xml version="1.0" encoding="UTF-8"?>
<library>
<groups>
<group name="fonts" expanded="true">
<folder>H:\fonts\Akrobat</folder>
<folder>H:\fonts\Amsdam Regular</folder>
<folder>H:\fonts\Arkhip</folder>
</group>
</groups>
<sets>
<set name="готичесие"/>
<set name="рисованные"/>
</sets>
</library>
@echo off
for /f %%a in ('dir /b /a:d /o:n "H:\fonts\*"') do (
echo "<folder>H:\fonts\%%a</folder>" >> library.xml
)
pause
"<folder>H:\fonts\Akrobat</folder>"
"<folder>H:\fonts\Amsdam</folder>"
"<folder>H:\fonts\Anchor</folder>"
...
Answer the question
In order to leave comments, you need to log in
Problem #1: If you remove the quotes, the < > characters will cause errors because these are service symbols in batch files - redirect symbols. Try escaping them: ^> ^<
Try it, it might work with escaping. In general, in batch files there is a problem with shielding, sometimes unsolvable. Several times I came across the fact that it was easier to write a script, for example in javascript, due to a problem with escaping service characters.
But you have a simple option, it should work. I can't check myself right now.
Problem #2: Make your loop look like this:
for /f "tokens=* delims=" %%a in ('dir /b /a:d /o:n "H:\fonts\*"')
Problem #3: I would suggest that you make 2 blanks for the resulting xml - the part before the insertion (header) and the part after the insertion. After forming the insert, simply fold 3 parts like this:
copy header.xml+insert.xml+footer.xml library.xml
Or generate the rest of the xml with a batch file.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question