嗨,我是苹果脚本的新手,但我正在尝试制作一个独立的应用程序,根据请求将使用是和否列表打开 Apple Mail。我是新手,所以任何帮助将不胜感激。我在下面附上了我的代码。
set Unread_Count to unread count of inbox
if Unread_Count is 0 then
say "Sir, it appears you have no new email's"
else if Unread_Count is 1 then
say "You have 1 new email"
else
say "You have " & (get Unread_Count) & " unread emails"
end if
end tell
tell application "SpeechRecognitionServer"
set yes_list to {"yes", "yes open mail", "yes open mail server", "yes please"}
set no_list to {"That's all", "no"}
set answer to listen for yes_list & no_list with prompt "Would you like me to open your mail server? Or will that be all."
-- you have to hold the Listening key (by default ⎋) to record a reply
if answer is no_list then
delay 0.2
say "Very well sir."
end if
if answer is yes_list then
tell application "Mail"
reopen
activate
end tell
end if
end tell
不幸的是,即使我的命令被识别,我的操作也不起作用。任何帮助将不胜感激!谢谢!