Sine of the times: Much better window shaker
Sine of the times: Much better window shaker
- Subject: Sine of the times: Much better window shaker
- From: David Crowe <email@hidden>
- Date: Thu, 20 Mar 2003 15:48:42 -0800
The following window shaker function uses the 'sin' function (from
SATImage OSAX) to provide an up and down motion, along with a bit of
maths to provide a slow decay. Changing the second parameter
increases the resolution of the movement.
tell application "Finder" to set w to (window 1)
NodWindow(w, 100)
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
- David Crowe
_______________________________________________
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.