Re: Yosemite appears to have broken shell script
Re: Yosemite appears to have broken shell script
- Subject: Re: Yosemite appears to have broken shell script
- From: Robert Poland <email@hidden>
- Date: Wed, 29 Oct 2014 08:12:22 -0600
> 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
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden