• 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: Safari windows
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Safari windows


  • Subject: Re: Safari windows
  • From: Walter Ian Kaye <email@hidden>
  • Date: Thu, 8 Jan 2004 02:29:06 -0800

At 10:45a +0100 01/08/2004, Jakub Formanek didst inscribe upon an electronic papyrus:

I have beginner question. How to get/set window position in Safari?


You mean because 'position' is not listed as a window property?

This means you have to use 'bounds' {left, top, right, bottom} instead.
Position is really just the first two items of the bounds.

If you want to preserve the existing width/height, you'll need to save the existing bounds and do some arithmetic to arrive at the new bounds.
Here's an example:


property default_pos_str : "0, 22"

display dialog "Move Safari window to:" default answer default_pos_str
set {newL, newT} to {word 1, word 2} of text returned of result

tell application "Safari"
set oldBounds to bounds of window 1
end tell

copy ((item 3 of oldBounds) - (item 1 of oldBounds)) to wd
copy ((item 4 of oldBounds) - (item 2 of oldBounds)) to ht

tell application "Safari"
set bounds of window 1 to {newL, newT, wd + newL, ht + newT}
end tell


-boo
_______________________________________________
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: Safari windows
      • From: Walter Ian Kaye <email@hidden>
References: 
 >Safari windows (From: Jakub Formanek <email@hidden>)

  • Prev by Date: Safari windows
  • Next by Date: Subject: Re: Photoshop 7.0 Save As Problems
  • Previous by thread: Safari windows
  • Next by thread: Re: Safari windows
  • Index(es):
    • Date
    • Thread