Re: Safari windows
Re: Safari windows
- Subject: Re: Safari windows
- From: Walter Ian Kaye <email@hidden>
- Date: Fri, 9 Jan 2004 05:13:20 -0800
At 08:51a -0400 01/09/2004, Bill Briggs didst inscribe upon an
electronic papyrus:
At 4:26 AM -0800 09/01/04, Walter Ian Kaye wrote:
At 02:29a -0800 01/08/2004, Walter Ian Kaye didst inscribe upon an
electronic papyrus:
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
Hmm. A Panther user wrote to tell me it doesn't work on his machine.
For a perfectly good reason.
Could someone with 10.3.2 and Safari 1.1.1 give it a try?
Sure. The problem is that you're trying to set bounds using _text_
strings as the bounds instead of integers (if you run just the first
two lines of yours script and look at the results you'll see the
problem).
But it's *not* a problem on my machine. Works just as I would expect.
Safari doesn't coerce them automatically.
Odd. 1.0 does. I'd say it's a bug in 1.1.1.
If you modify the display dialog line to coerce the text returned to
numbers, as below, then your script works.
Hmm. But I did anticipate and suggest that to him, just in case:
What is the result of {newL, newT, wd + newL, ht + newT} ?
Tried setting them to 0,22,800,600
Also try {0 + newL, 0 + newT, wd + newL, ht + newT} to pre-coerce "0" to 0.
thanks,
-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.