Re: Code for a circle
Re: Code for a circle
- Subject: Re: Code for a circle
- From: Deivy Petrescu <email@hidden>
- Date: Thu, 13 Mar 2003 19:12:04 -0500
On Thursday, Mar 13, 2003, at 17:40 US/Eastern, Deivy Petrescu wrote:
There is a glitch in the script. I've used alt-< and the server got
it as !B (in MM).
Change that for an alt -<. Also, since we are at it, fix the first ry,
it should be "set ry to ((30 ^ 2 - r ^ 2) ^ (1 / 2) div 0.1) / 10"
saves some "finder" computation.
<Script for the circle>
tell application "Finder"
activate
try
set r to 30
-- r is the radius
set numtimes to 30
-- the maximum number of steps
set jump to 10
--well, jump is jump in the repeat loop
set frontWindow to window 1
set {x0, y0} to position of frontWindow
set position of frontWindow to {x0 + r, y0}
--move the window radius pixel away in the positive x direction.
repeat with i from 1 to (4 * numtimes) by jump
(*
change the x position by jump and check what the y position should be
to get the position of the window
*)
if i !B (2 * numtimes) then
the line above is where the !B is
set r to (r - 1 * jump)
set ry to (30 ^ 2 - r ^ 2) ^ (1 / 2)
this is the ry that should be changed.
else
set r to (r + 1 * jump)
set ry to ((-1 * ((30 ^ 2 - r ^ 2) ^ (1 / 2))) div 0.1) / 10
end if
set position of frontWindow to {x0 + r, y0 + ry}
end repeat
on error msg
msg
end try
set position of frontWindow to {x0, y0}
-- send the window back to the original position
end tell
<end script>
Deivy Petrescu
http://www.dicas.com/
_______________________________________________
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.