0

私は現在 AppleScript を学んでいる学生で、特定のコマンドをループするのに苦労しています。誰か助けてくれませんか? コードは次のとおりです。私の目的は、ユーザーが無効な値を入力した場合にのみループすることです。

私は与えられた助けに感謝します:)

どうもありがとう アンドリュー

    display dialog "Choose a number from 1-10" default answer "Only number less than 11" buttons {"Ok"} default button 1

try

    set theAnswer to (text returned of result) as number

on error

    display dialog "You didnt put in any numbers" buttons {"Ok"} default button 1
    return

end try
if theAnswer < 1 then
    set theTest to 0
else if theAnswer < 11 then
    set theTest to 1

else
    set theTest to 0
end if
if theTest = 0 then
    display dialog "Invalid Input" buttons {"Ok"} default button 1

else
    display dialog "You chose the number " & theAnswer buttons {"Ok"} default button 1
end if
4

1 に答える 1