为什么我不断收到错误“无法将 \"0.0\" 转换为类型号。” 从“0.0”到数字的数字-1700?如果我删除为 number,则始终显示显示对话框。
tell application "System Events"
repeat
set PID to unix id of process "JPEGmini"
set getCpuPercent to "ps aux | grep " & PID & " | grep -v grep | awk '{print $3}'"
set cpuPercent to (do shell script getCpuPercent) as number
if (cpuPercent) < 5 then
display dialog cpuPercent
end if
end repeat
end tell