Hello all,
I know how I can use "display" to show an image, but I'd like to do something a little more advanced and ask the user a question, like "Is this the right image?" and get a Y/N answer. All this from a shell script.
I don't see any direct way to do this in IM without a lot of clicking to close the window and ask the question afterwards from the command line.
Any suggestions ?
Thanks.
Doing an image popup from a script
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Doing an image popup from a script
You have to use unix commands and reply at the terminal. See man pages for "read"
#!/bin/bash
convert rose: show:
echo -n "Press c to continue Or q to quit:"
read -n 1 prompt
if [ "$prompt" = "q" ]; then
echo ""
echo "quitting"
exit 0
fi
echo ""
echo "script has continued"
exit 0
see also http://www.imagemagick.org/Usage/files/#show for the x: window display options (rather than show:)
#!/bin/bash
convert rose: show:
echo -n "Press c to continue Or q to quit:"
read -n 1 prompt
if [ "$prompt" = "q" ]; then
echo ""
echo "quitting"
exit 0
fi
echo ""
echo "script has continued"
exit 0
see also http://www.imagemagick.org/Usage/files/#show for the x: window display options (rather than show:)
Re: Doing an image popup from a script
Thanks. I'd been thinking along that, but the focus changes are annoying. Someone suggested a great method using zenity here.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Doing an image popup from a script
One method would be with HTA (hypertext application). This needs a web browser that supports HTA, of course.
snibgo's IM pages: im.snibgo.com