I am making a new script.
The structure of the script has to be:
question 1 > yes or no
if question 1 = yes do something
if question 1 = no go tot question 2
question 2 > 1 or 2
if question 2 = 1 go to question 3
if question 2 = 2 go to question 4
question 3 > a, b or c
if question 3 = a do something
if question 3 = b do something
if question 3 = c do something
question 4 > d, e or F
if question 3 = d do something
if question 3 = e do something
if question 3 = f do something
Now my problem is I can’t let work the second question…
set TempKArray to {“20”, “24”}
set TempAArray to {“90”, “75”, “70”, “55”, “35”}
set TempRArray to {“70”, “65”, “55”, “45”, “30”}
set Prijzensql to “SELECT tbProducts.prod_id, tbProducts.prod_code AS Prod_code, tbProductProperties.prop_description AS Description,
tbProductProperties.prop_prize_standard_pc AS S, tbProductProperties.prop_prize_others_pc AS A,
tbProductProperties.prop_width AS Breedte, tbProductProperties.prop_height AS Hoogte,
tbProductProperties.prop_length AS Lengte, tbProductProperties.prop_weight AS Gewicht, tbProductProperties.prop_type AS Type,
tbProductProperties.prop_height AS W, tbProductProperties.prop_length AS X, tbProductProperties.prop_type AS Y,
tbProductProperties.prop_width AS Z, tbProductProperties.prop_fk_lang_id AS Lang_id
FROM tbProducts INNER JOIN
tbProductProperties ON tbProducts.prod_id = tbProductProperties.prop_fk_prod_id”
set OriginalSql to (display dialog "Moet je enkel nieuwe prijzen inhalen?" buttons {"Ja", "Nee"} default button {"Ja"})
if button returned of OriginalSql is "Ja" then
set OriginalSql to Prijzensql
else
set OriginalSql to (display dialog "Hoeveel kamertemperaturen wens je weer te geven?" buttons {"1", "2"} default button {"1"})
if button returned of OriginalSql is "1" then
set Kamer1 to (choose from list TempKArray with prompt "Selecteer de gewenste kamertemperatuur." default items {"20"} without multiple selections allowed) as text
set OriginalSql to (display dialog "Hoeveel afgiftes wens je weer te geven?" buttons {"2", "3"} default button {"2"})
if button returned of OriginalSql is "2" then
set Em to {}
repeat with i from 1 to count of TempAArray
set end of Em to (item i of TempAArray & "/" & item i of TempRArray) as string
end repeat
set Antw1 to (choose from list Em with prompt "Selecteer de gewenste eerste afgifte" default items {"75/65"} without multiple selections allowed) as text
set Aanvoer1 to characters 1 thru 2 of Antw1 as string
set Retour1 to characters 4 thru 5 of Antw1 as string
set Em2 to {}
repeat with x from 1 to count of items of Em
set n to item x of Em
if n is not in Antw1 then set end of Em2 to n
end repeat
set Antw2 to (choose from list Em2 with prompt "Selecteer de gewenste tweede afgifte" default items {"55/45"} without multiple selections allowed) as text
set Aanvoer2 to characters 1 thru 2 of Antw2 as string
set Retour2 to characters 4 thru 5 of Antw2 as string
set OriginalSql to KAAsql
end if
end if
end if
end tell
who can help me???