Re: Sine of the times: Much better window shaker
Re: Sine of the times: Much better window shaker
- Subject: Re: Sine of the times: Much better window shaker
- From: Emmanuel <email@hidden>
- Date: Fri, 21 Mar 2003 11:29:27 +0100
At 3:48 PM -0800 20/03/03, David Crowe wrote:
on NodWindow(w, nsteps)
--The window will shake up and down three times.
tell application "Finder"
activate
set {xPrime, yPrime} to position of w
repeat with i from 1 to nsteps
set position of window 1 to {xPrime, yPrime +
(50 * nsteps) / (nsteps + i) * (sin (i * 5 * pi / (nsteps)))}
end repeat
set position of window 1 to {xPrime, yPrime}
end tell
end NodWindow
Quite nice!
And you get a still smoother feel if you make the damping term more
natural, i.e. exponential:
... yPrime + 50 * (exp (-5 * i / nSteps)) * (sin (i ...
Emmanuel
_______________________________________________
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.