• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Sine of the times: Much better window shaker
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Sine of the times: Much better window shaker (From: David Crowe <email@hidden>)

  • Prev by Date: Re: Eudora users - Did you know that...
  • Next by Date: Re: Unicode search [was Re: the Holy Grail of AppleScript lists]
  • Previous by thread: Sine of the times: Much better window shaker
  • Next by thread: Re: Sine of the times: Much better window shaker
  • Index(es):
    • Date
    • Thread