I got a couple of weird named files from my bank that include ampersands in the names.
My scripts seem to handle it fine until it gets into yad for displaying it to the user.
These are "production" scripts that I use many times a day and I have been refining them for years. It's not new code.
Even though this one display is wrong, the rest of the script runs perfectly.
Please take a look at this and see if you can tell if it's a bug in my code or in yad.
TIA
Joe - very appreciative yad user
yad version 0.21.0-1~webupd8~precise (from the ppa)
running on kubuntu precise 64 bit
----
My yad dialog shows up, but its content is all blank.
This is my "Print Preview" dialog. When I select OK, the rest of the script works fine - including several other calls to yad. The code is:
## Preview Print Queue
##\( -iname "*.txt" ! -iname ".*" \)
CHOICES="$(find . -maxdepth 1 -type f ! -name '\.*' -printf '"%f"\n' | sort)"
##echo "CHOICES [${CHOICES}]"
CHOICES="$(echo ${CHOICES} | sed -r -e 's/\n/\" /')"
##echo "CHOICES [${CHOICES}]"
yad --title " Preview Print Queue " --on-top --tail \
--text=" Select ${YYES} to Continue\n\nSelect ${YNO} to Skip Printing\n\n$(eval mprb -i ${CHOICES})" \
--width=400 --height=500 --question
if [ "$?" -ne 0 ]
then
RC=0
quit
fi
The whole thing is at:
https://sourceforge.net/projects/duplexpr/Here's what shows up with debugging turned on (just the snip of that portion where the error occurs):
+ yad --title ' Preview Print Queue ' --on-top --tail '--text= Select OK to Continue\n\nSelect Cancel to Skip Printing\n\nPrinting 1 of 5 - [01] - 2 pages
Printing 2 of 5 - [02] - 2 pages
Printing 3 of 5 - [agreement_consent_electronic_disclosures.pdf] - 5 pages
Printing 4 of 5 - [Pollock+-+address+change+form+&+atm+card+application+&+agreement.pdf] - 6 pages
Printing 5 of 5 - [Pollock+-+signature+card+&+disclosure.pdf] - 10 pages
Printing 5 jobs with 25 pages
13 Sheets per pass' --width=400 --height=500 --question
(yad:10435): Gtk-WARNING **: Failed to set text from markup due to error parsing markup: Error on line 8: Entity did not end with a semicolon; most likely you used an ampersand character without intending to start an entity - escape ampersand as &
(yad:10435): Gtk-WARNING **: Failed to set text from markup due to error parsing markup: Error on line 8: Entity did not end with a semicolon; most likely you used an ampersand character without intending to start an entity - escape ampersand as &