Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ###########################################################
- -->> ABOUT
- ###########################################################
- (*
- Phil Stokes -- 2017
- applehelpwriter.com
- sqwarq.com
- *)
- ###########################################################
- -->> DESCRIPTION
- ###########################################################
- (*
- Report the mac's thermal state
- *)
- ###########################################################
- -->> USAGE
- ###########################################################
- (*
- Requires 10.10.3 or later.
- Run the script when you hear the fans or are worried about the mac's thermal state.
- *)
- ###########################################################
- -->> IMPORT STATEMENTS
- ###########################################################
- use AppleScript version "2.4" -- Yosemite (10.10) or later
- use scripting additions
- use framework "Foundation"
- ###########################################################
- -->> COMMANDS
- ###########################################################
- set d to (current date) as text
- set NSProcessInfo to a reference to current application's NSProcessInfo
- set procInfo to NSProcessInfo's alloc's init
- set n to procInfo's thermalState()
- set msg to "Error - could not get thermal state."
- if n = 0 then
- set msg to "NSProcessInfoThermalStateNominal - No corrective action needed."
- else if n = 1 then
- set msg to "NSProcessInfoThermalStateFair - The system has reached a state where fans may become audible."
- else if n = 2 then
- set msg to "NSProcessInfoThermalStateSerious - Fans are running at maximum speed, system performance maybe impacted. Recommendation: reduce application's usage of CPU, GPU and I/O, if possible. Switch to lower quality visual effects, reduce frame rates."
- else if n = 3 then
- set msg to "NSProcessInfoThermalStateCritical - System performance is significantly impacted and the Mac needs to cool down. Recommendation: reduce application's usage of CPU, GPU, and I/O to the minimum level needed to respond to user actions. Consider stopping use of camera and other peripherals if your application is using them."
- end if
- set msg to d & return & return & msg
- return msg
- # display dialog msg with icon 1 buttons "OK" default button "OK" with title "NSProcessInfoThermalState"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement