content: set home to POSIX path of (path to "cusr")
  set configFileName to ".hot_corner_saver"
  global configFilePath
  set configFilePath to home & configFileName
  
  -- Make sure the file exists
  do shell script "touch '" & configFilePath & "'"
  
  global hotCornerSettings
  set hotCornerSettings to loadConfigFile()
  
  to readFile(unixPath)
  	set fRef to (open for access (POSIX file unixPath))
  	set txt to (read fRef for (get eof fRef))
  	close access fRef
  	return txt
  end readFile
  
  to writeFile(unixPath, content)
  	set fRef to (open for access (POSIX file unixPath) with write permission)
  	set eof fRef to 0
  	write content to fRef
  	close access fRef
  end writeFile
  
  to joinList(aList, delimiter)
  	set retVal to ""
  	set prevDelimiter to AppleScript's text item delimiters
  	set AppleScript's text item delimiters to delimiter
  	set retVal to aList as string
  	set AppleScript's text item delimiters to prevDelimiter
  	return retVal
  end joinList
  
  to loadConfigFile()
  	return every paragraph of readFile(configFilePath)
  end loadConfigFile
  
  to writeConfigFile()
  	set content to joinList(hotCornerSettings, "
  ")
  	writeFile(configFilePath, content)
  end writeConfigFile
  
  to disableHotCorners()
  	tell application "System Preferences"
  		activate
  		set current pane to pane id "com.apple.preference.expose"
  		tell application "System Events"
  			tell window "Mission Control" of process "System Preferences"
  				click button "Hot Corners…"
  				tell sheet 1
  					tell group 1
  						set theCurrentValues to value of pop up buttons
  						copy theCurrentValues to hotCornerSettings
  						repeat with i from 1 to 4
  							tell pop up button i
  								click
  								click last menu item of menu 1
  							end tell
  						end repeat
  					end tell
  					click button "OK"
  				end tell
  			end tell
  		end tell
  		quit
  	end tell
  	writeConfigFile()
  end disableHotCorners
  
  to restoreHotCorners()
  	tell application "System Preferences"
  		activate
  		set current pane to pane id "com.apple.preference.expose"
  		tell application "System Events"
  			tell window "Mission Control" of process "System Preferences"
  				click button "Hot Corners…"
  				tell sheet 1
  					tell group 1
  						repeat with i from 1 to 4
  							tell pop up button i
  								click
  								click menu item (item i of hotCornerSettings) of menu 1
  							end tell
  						end repeat
  					end tell
  					click button "OK"
  				end tell
  			end tell
  		end tell
  		quit
  	end tell
  end restoreHotCorners
  
  if length of hotCornerSettings is not 0 then
  	set result to display dialog "Hot corner settings..." buttons {"Disable", "Cancel", "Restore"} default button 3
  else
  	set result to display dialog "Hot corner settings..." buttons {"Disable"} default button 1
  end if
  
  if (button returned of result) is "Disable" then
  	disableHotCorners()
  else if (button returned of result) is "Restore" then
  	restoreHotCorners()
  end if
  