Joe
unread,Mar 8, 2013, 7:54:20 PM3/8/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to yad-c...@googlegroups.com
I'm trying out my first form!
I have a very simple working script to print multiple copies of a print file and I'm trying to build a yad front end for it.
Everything works, but the initial value and range for COPIES is being ignored.
Eventually, I want to read variables from yad, but that is commented out until I get yad to work by itself.
What have I coded wrong so the range is ignored?
What (if anything) do I have to change or escape when I put the read code back in?
(I added a blank line after the commented out read just in case. It's only there while the line is commented out.)
Is there a way to tell "NUM" to return an integer? I know how to parse the float if I have to.
TIA
Joe
kubuntu oneiric - latest yad from ppa 0.19.1
#!/bin/bash
## kprc
## print multiple copies of a print file
## Copyleft 03/08/2013 - JPmicrosystems
## Usage kprc
source /home/bigbird/bin/bash_trace
SCRIPT_NAME="Print Copies"
##USAGE="Usage is ${SCRIPT_NAME} [-1] <count> <file>"
##DSPTIME=5 ## yad message timeout interval
PQ="${HOME}/pq"
cd "${PQ}"
##IFS='|' read FILE COPIES ONE_SIDED <<< "$( \
yad --title "${SCRIPT_NAME}" --on-top --form \
--field="Print File":FL \
--field="Copies:NUM" '2!0..50!1!0' \
--field="One-sided":CHK \
--width=250 \
##)"
exit ## debug
echo "FILE [${FILE}] COPIES [${COPIES}] ONE_SIDED [${ONE_SIDED}]"
COPIES="${COPIES%%.*}"
[ "${FILE}" == "(null)" ] && FILE=""
[ "${ONE_SIDED}" == "TRUE" ] && ONE_SIDED=1 || ONE_SIDED=0
echo "FILE [${FILE}] COPIES [${COPIES}] ONE_SIDED [${ONE_SIDED}]"