• 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: Christopher Stone <email@hidden>
  • Date: Wed, 29 Oct 2014 08:59:13 -0500

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

 _______________________________________________
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

  • Follow-Ups:
    • Re: Yosemite appears to have broken shell script
      • From: Robert Poland <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>)

  • Prev by Date: Re: Yosemite appears to have broken shell script
  • Next by Date: Re: Yosemite appears to have broken shell script
  • 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