2
我在連續使用少於或大於運算符的AppleScript中出現錯誤。我可能沒有很好地解釋,所以我會發布代碼。AppleScript少於數字或大於數字
**set good to false**
**repeat until good = true**
set oneTen to the text returned of (display dialog "Pick a number from 1 through 10" default answer "" buttons {"OK"} default button 1) as number
if oneTen is less than 0 then
display dialog "below" buttons {""} default button 1
else if oneTen is greater than 10 then
display dialog "above" buttons {""} default button 1
else
set good to true
end if
**end repeat**
我試圖從提示輸入,並保持用戶進入低於0或10以上任何你可以張貼一些代碼來做到這一點呢?
我想要類似這樣的東西。
**set oneTen to the text returned of (display dialog "Pick a number from 1 through 10" default answer "" buttons {"OK"} default button 1) as number**
**if oneTen is less than 0 or greater than 10 then**
**-- make them do the prompt again**
**end if**
我忘了說。謝謝!! – XQLRSZ