Hi rowoflo,
You can get the screen resolution using code as follows:
set command to "/usr/sbin/system_profiler SPDisplaysDataType | grep Resolution"
set output to words of (do shell script command)
set {dspwidth, dspheight} to {item 2, item 4} of output
Best regards from Germany!