0
我是一名正在學習AppleScript的學生,我在循環某個特定命令時遇到困難,請問有人能幫助我嗎?代碼如下,我的目標是僅在用戶輸入無效值時才循環。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
謝謝!你剛剛解決了我的問題!非常感激 :) – user2509708