Page 1 of 1

Answer Dialog with variable buttons

Posted: Fri Oct 07, 2016 3:24 pm
by mimu
May idea is to build a variable string in tdialog to get an answer dialog with 1 , 2 ,3,4 or 5 buttons

how do i escape the string correctly to get 3 buttons in this example?

on mouseUp
put "button1" into t1
put "button2" into t2
put "button3" into t3
put t1 && "or" && t2 "or" && t3 into tdialog

answer "What to do" with tdialog
end mouseUp

Re: Answer Dialog with variable buttons

Posted: Fri Oct 07, 2016 3:33 pm
by Klaus
Hallo Berliner Pflanze,

this is a case for DO, tested and works:

Code: Select all

on mouseUp 
   put "button1" into t1
   put "button2" into t2
   put "button3" into t3
   put t1 && "or" && t2 && "or" && t3 into tdialog
   put QUOTE & "What to do:" & QUOTE  into tQ
   do ("answer" && tQ && "with" && tdialog)
end mouseUp
Best

Klaus

Re: Answer Dialog with variable buttons

Posted: Fri Oct 07, 2016 3:39 pm
by mimu
Super, Vielen dank

Re: Answer Dialog with variable buttons

Posted: Sat Oct 08, 2016 8:34 pm
by jacque
This works too, without "do":

Code: Select all

put "button1" into t1
put "button2" into t2
put "button3" into t3
answer "test dialog" with t1 and t2 and t3