• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Yosemite appears to have broken shell script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Yosemite appears to have broken shell script


  • Subject: Re: Yosemite appears to have broken shell script
  • From: Yvan KOENIG <email@hidden>
  • Date: Wed, 29 Oct 2014 15:25:37 +0100


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



 _______________________________________________
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

References: 
 >Yosemite appears to have broken shell script (From: Robert Poland <email@hidden>)
 >Re: Yosemite appears to have broken shell script (From: Shane Stanley <email@hidden>)
 >Re: Yosemite appears to have broken shell script (From: Robert Poland <email@hidden>)
 >Re: Yosemite appears to have broken shell script (From: Shane Stanley <email@hidden>)
 >Re: Yosemite appears to have broken shell script (From: Shane Stanley <email@hidden>)
 >Re: Yosemite appears to have broken shell script (From: Robert Poland <email@hidden>)
 >Re: Yosemite appears to have broken shell script (From: Emmanuel LEVY <email@hidden>)
 >Re: Yosemite appears to have broken shell script (From: Robert Poland <email@hidden>)
 >Re: Yosemite appears to have broken shell script (From: Christopher Stone <email@hidden>)
 >Re: Yosemite appears to have broken shell script (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: Yosemite appears to have broken shell script
  • Next by Date: Create link in OSX Mail
  • Previous by thread: Re: Yosemite appears to have broken shell script
  • Next by thread: Re: Yosemite appears to have broken shell script
  • Index(es):
    • Date
    • Thread