Code for a circle
Code for a circle
- Subject: Code for a circle
- From: Paul Skinner <email@hidden>
- Date: Thu, 13 Mar 2003 13:49:28 -0500
Can anyone explain the formula I should use to generate values for the
position of a window such that the values all fall close to lying on a
30 pixel diameter circle ?
What I'm trying to do is make a window politely draw attention to
itself. I currently use this bit...
tell application "Finder"
activate
try
set frontWindow to window 1
set {x, y} to position of frontWindow
repeat with v from 30 to 10 by -10
set r to (v / 10)
repeat with i from 1 to v by r
set position of frontWindow to {x + i, y}
end repeat
set x to x + v
repeat with i from 1 to v by r
set position of frontWindow to {x, y + i}
end repeat
set y to y + v
repeat with i from 1 to v by r
set position of frontWindow to {x - i, y}
end repeat
set x to x - v
repeat with i from 1 to v by r
set position of frontWindow to {x, y - i}
end repeat
set y to y - v
end repeat
end try
end tell
This moves the front finder window in three progressively smaller
squares. The result isn't too bad, but I'd like to move it in circles
rather than a square. It just seems that would be more Mac OS X-like in
behavior.
Paul Skinner
_______________________________________________
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.