Page 1 of 1

Doing an image popup from a script

Posted: 2012-12-19T03:59:38-07:00
by dargaud
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.

Re: Doing an image popup from a script

Posted: 2012-12-19T21:52:53-07:00
by fmw42
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:)

Re: Doing an image popup from a script

Posted: 2012-12-21T06:40:31-07:00
by dargaud
Thanks. I'd been thinking along that, but the focus changes are annoying. Someone suggested a great method using zenity here.

Re: Doing an image popup from a script

Posted: 2012-12-21T08:56:34-07:00
by snibgo
One method would be with HTA (hypertext application). This needs a web browser that supports HTA, of course.