This handler is failing for me in Lion. Has worked for ages with Snow Leopard.
The error <Expected end of line, etc. but found""".> occurs at the quote at the end here set mainMonitor to change " both occurrences.
on getMonitorSize() -- Get monitor size and dimensions
set originalDelimiters to AppleScript's text item delimiters
set AppleScript's text item delimiters to return
set screenData to do shell script "CScreen -L"
set mainMonitor to text item 1 of screenData -- get line 1
set mainMonitor to change "^[[:space:]]+" into "" in mainMonitor with regexp
-- remove leading space
set mainMonitor to change "[[:space:]]+" into " " in mainMonitor with regexp
-- change all multiple spaces into one space
set AppleScript's text item delimiters to space
set original_R to text item 3 of mainMonitor
set original_B to text item 4 of mainMonitor
set AppleScript's text item delimiters to originalDelimiters
end getMonitorSize
TIA,
Robert Poland - Fort Collins, CO