Get Entire Desktop size, use to limit search area


I’ve been working on a desktop automation, that goes beyond the browser and also automates a popup application that is launched automatically during the process. Overall, I’m thrilled with the progress that I’ve been able to make with this, but I’ve been having some reliability and performance problems that I think limiting the search area could help.

I saw the example script, which uses visual assert to find a spot on the screen, and then some math to define the search area, but I’d like to do something that I think is simpler: Quadrants. I’d like an include macro called “topleft”, which would limit the search area to the top left corner of the entire monitor, not just a browser window. I’d then make more versions of that include called “topright” and so forth to narrow the search area to the places needed, rather than hunting through the entire screen.

Does that make sense? And, if so, what variable can I use to detect the screen size? Do I just do that with a javascript call? I might try that anyways, but I’m definitely open to ideas if anybody has suggestions.