【发布时间】:2015-02-21 12:53:39
【问题描述】:
我正在尝试使用 Applescript,但看不出有什么问题。 我得到的错误是
错误“无法结束{返回的按钮:\"OK\",返回的文本:\"3\"}。"从 {button 返回的最后一个插入点开始的数字 -1728:“OK”,返回的文本:“3”}
这是我的代码:
beep
set counter to 0
set tempX to 0
set temp to 0
set counting to 0
set stored to {0}
set input to "How many grades do you wish to enter?" as string
set str to display dialog input buttons {"NEXT"} default button "NEXT" default answer ""
repeat text returned of str times
counting = counting + 1
set grades to display dialog "GRADES: " default answer ""
set stored to grades
end repeat
set rep to the length of stored
repeat rep times
counter = counter + 1
set tempX to the ((end of stored) - counter) as number
set temp to temp + tempX
end repeat
set ln to the length of grades
set average to temp / ln
if text returned of str is 1 then
say "The Average of your grade is " & average using "Zarvox"
else
say "The Average of your grades is " & average using "Zarvox"
end if
get "AVERAGE: " & average
【问题讨论】:
标签: macos applescript average