我想找到一种方法来报告硬件温度回到我没有一个程序,我不得不下载,我知道很多做的显示,但不报告回到远程位置上的网络。硬件温度报告
我发现了一个applescript,我可能会修改它以使其正常工作,但我目前正在步骤1中停止运行脚本。
下面是我找到的脚本。我一直在标线得到一个错误,幸运的13行 错误只是说不能得到项目17
set the_result to (do shell script "ioreg -c IOHWSensor | grep -vE '\\{|\\}|\\+\\-o'")'s paragraphs
set all_display to ""
repeat with i from 0 to 16
set jump to 3
set the_location to item (3 + (jump * i)) of the_result
set the_location to characters 41 thru ((count of characters of the_location) - 1) of the_location as string
set the_type to item (4 + (jump * i)) of the_result
set the_text to item (2 + (jump * i)) of the_result as string
**set the_text to characters 44 thru (count of characters of the_text) of the_text as string --(length of item 2 of the_result)**
set the_type to characters 37 thru ((count of characters of the_type) - 1) of the_type as string
if the_type = "temperature" then
set all_display to all_display & "
" & the_location & ": " & ((the_text/65536) * (9/5)) + 32 & " F" as string
end if
end repeat
display dialog all_display
我与这一次终于能够得到完整的错误 错误玩弄:无法将“| | | | | \”version \“= 2”中的字符44到41转换为字符串类型。
10.6.8 我的理解是,虽然所有的英特尔Mac的将在很大程度上类似。 显然,如果他们不是那会是一个问题。 但是,此脚本在温度之前出错。 – 2012-08-06 12:32:36
我的观点是,它永远不会找到温度关键字。无论如何,你可以简单地删除| grep -vE'\\ {| \\} | \\ + \\ - o'从脚本运行并再次运行。它试图摆脱+ o \ |符号。 – artapet 2012-08-08 05:12:38