• 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
Getting desktop bounds (was: Re: Isn't there a way...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting desktop bounds (was: Re: Isn't there a way...


  • Subject: Getting desktop bounds (was: Re: Isn't there a way...
  • From: John Delacour <email@hidden>
  • Date: Sat, 2 Aug 2003 19:52:54 +0100
  • Mac-eudora-version: 6.0a29

At 2:16 pm -0700 30/07/03, Allen Watson wrote:

> set bounds of window 1 to {x, y, x + (x2 - x1), y + (x2 - x1)}

John, shouldn't the last part be "(y2 - y1))}"? When I ran your version my
window extended off the bottom of the screen; when I changed it to this, it
seemed to work properly.

Well actually it was the line before that I got wrong.


I've now discovered that you don't need to have Jon's commands installed; the thing can be done using just System Events:-


set _frontapp to (path to frontmost application) as Unicode text
tell app "System Events" to tell process "Finder" to [OPTION-L]
set {dx, dy} to size of windows whose position is {0, 0}
tell app _frontapp
set {x1, y1, x2, y2} to bounds of window 1
set {x, y} to {(dx - (x2 - x1)) / 2, (dy - (y2 - y1)) / 2}
set bounds of window 1 to {x, y, x + (x2 - x1), y + (y2 - y1)}
end

-- JD




.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Getting desktop bounds (was: Re: Isn't there a way...
      • From: Paul Skinner <email@hidden>
    • Re: Getting desktop bounds (was: Re: Isn't there a way...
      • From: Glenn Sugden <email@hidden>
  • Prev by Date: Re: Thanks
  • Next by Date: Re: Thanks
  • Previous by thread: tell Finder to move files
  • Next by thread: Re: Getting desktop bounds (was: Re: Isn't there a way...
  • Index(es):
    • Date
    • Thread