• 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
Zoom Script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Zoom Script


  • Subject: Zoom Script
  • From: Robert Poland <email@hidden>
  • Date: Tue, 3 Oct 2006 18:28:36 -0600

Hi,

Because in OS 10.4.8 The zoom button will not zoom a window to a minimum size unless it has been resized.

I have this script that in  response to a iKey shortcut command reduces the frontmost window 2% then clicks the Zoom button. The problem is that if the window has a vertical scroll that is not to the top it will resize only from that point down (Sometimes).

I have been trying to find a command that will set the scroll to the top of the window but haven't any luck.

Any suggestions?

if exists window 1 of application "Finder" then
tell application "Finder" to try
tell window 1 to select item 1
keystroke chr(1) -- Escape key to deselect selection
end try
end if

tell application (path to frontmost application as Unicode text)
activate
tell window 1
set {leftSide, topSide, rightSide, bottomSide} to bounds
set x to (rightSide - leftSide) * 0.98 as integer -- get 98% of window size
set rightSide to leftSide + x
set bounds to {leftSide, topSide, rightSide, bottomSide}
end tell


try
if not window 1's zoomed then set window 1's zoomed to true
on error -- need alternate for finder
tell application "System Events" to tell ¬
(first process whose frontmost is true) to try
click button 2 of window 1
end try
end try
end tell

tell application "Finder" to tell window 1 to select {} -- deselect all choices


TIA,

Robert Poland
email@hidden



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Zoom Script
      • From: Philip Aker <email@hidden>
    • Re: Zoom Script
      • From: Luther Fuller <email@hidden>
  • Prev by Date: Re: Can't turn off screen savers in System Preferences
  • Next by Date: Re: Can't turn off screen savers in System Preferences
  • Previous by thread: Re: Can't turn off screen savers in System Preferences
  • Next by thread: Re: Zoom Script
  • Index(es):
    • Date
    • Thread