|
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
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
tell application "System Events" to tell process "Finder" to set {dx, dy} to size of windows whose position is {0, 0}
-->Can't get item 1 of {}.
| References: | |
| >Getting desktop bounds (was: Re: Isn't there a way... (From: John Delacour <email@hidden>) |
| Home | Archives | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2011 Apple Inc. All rights reserved.