Hi,
I’d like to make a script using the alert, so I can make some responses according to the button chosen by the user. If I understand well, the alert can get a maximum of 3 buttons.
I’ve found how to script with 2 buttons, but I can’t get the result from the 3rd one.
For example:
alert --info "One or Two or Three" One Two Three
if [ $? = 0 ]; then
echo "one chosen"
elif [ $? = 1 ]; then
echo "two chosen"
elif [ $? = 2 ]; then
echo "three chosen"
else
echo "can't be chosen"
fi
If I push the 3rd button, I’ll get this in the console:
Three
two chosen
What am I doing wrong?