我正在尝试找到一种无需下载程序即可将硬件温度报告给我的方法,我知道有很多可以显示但不报告给网络上的远程位置的方法。
我找到了一个苹果脚本,我可以对其进行修改以使其正常工作,但我目前正停留在第 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 转换为类型字符串。