Le 29/10/2014 à 15:12, Robert Poland < email@hidden> a écrit :
On Oct 29, 2014, at 7:59:AM, Christopher Stone <email@hidden> wrote:
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.
-- Take Care, Chris
I get tired of “Fixes”. Why would a set bounds command return a pixel result to the tenth of a pixel? Robert Poland Fort Collins CO
If I understand well, Emmanuel gave you what to do :
That kind of question is a question for SUL, I'm afraid.
We are all doing mistakes when we write scripts. The authors of Smile are humans like us. So they may do mistakes like us. Their product is FREE and they are its first (maybe its main users) so, I guess that if you report them the oddity, they will correct it or will explain why they had to introduce this behavior.
Yvan KOENIG (VALLAURIS, France) mercredi 29 octobre 2014 15:24:55
|