有人能解释一下为什么脚本编写突然如此缓慢吗?
即使是这个测试脚本也不会在120秒的超时之前完成。
tell application "Mail"
set selectedEmails to get selection -- returns a list
end tell
这可能是您的系统出现问题。在我的电脑上执行那个脚本不需要太多时间。
set time1 to do shell script "perl -e 'use Time::HiRes qw(time); print time'"
tell application "Mail" to set selectedEmails to get selection -- returns a list
set time2 to do shell script "perl -e 'use Time::HiRes qw(time); print time'"
set millisec to (round ((time2 - time1) * 1000))
return "Emails:" & (count of selectedEmails) & " Milliseconds:" & millisec
"电子邮件:1000毫秒:183"