The only problem with grep is that it can be too broad, and it can grab anything and everything that has the string Resolution in it. If you are running dual displays or hooked up to a projector when it runs this may cause issue. Of course I have not tested it, but for example if I did a grep for connections using port 548 it may grab these ports on a network connection:
1548 33548 153248
Since the string 548 is in all of those you may get wonky results.
Tweaked this extension attribute a bit so it will also pull windows machines screen resolutions as well.
Just paste this in the VBScript field after doing the above for the mac:
Set objWMIService = GetObject("Winmgmts:.
ootcimv2")
Set colItems = objWMIService.ExecQuery("Select * From Win32_DesktopMonitor where DeviceID = 'DesktopMonitor1'",,0)
For Each objItem in colItems
intHorizontal = objItem.ScreenWidth
intVertical = objItem.ScreenHeight
Next WScript.Echo "<result>" & intHorizontal&"x"&intVertical & "</result>"