On Oct 29, 2014, at 07:42, Robert Poland <email@hidden> wrote:On Oct 29, 2014, at 4:07:AM, Emmanuel LEVY <email@hidden> wrote: In Smile, you can run "screen bounds".
When I run; set {a, b, c, d} to screen bounds —> {0.0, 0.0, 2560.0, 1440.0}
I get the bounds to the nearest ONE Decimal Point, not very logical.
______________________________________________________________________
Hey Bob,
That just means they're being returned as reals instead of integers.
I get the same result from Shane's ASObjC when run from a library on 10.9.5.
Screen bounds is not very useful unless you're running from Smile though.
The fix is simple and very fast IF you want to bother.
set screenBounds to screen bounds repeat with i in screenBounds set contents of i to i as integer end repeat set {x1, y1, x2, y2} to screenBounds
This works just fine:
tell application "Finder" set bounds of front window to {0.0, 44.0, 870.0, 520.0} end tell
And if you're doing calculations with the screen bounds you can just turn them into integers at that time.
|