• 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
Sine of the times: Much better window shaker
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Sine of the times: Much better window shaker
      • From: Emmanuel <email@hidden>
    • Re: Sine of the times: Much better window shaker
      • From: Emmanuel <email@hidden>
  • Prev by Date: Re: passing info back
  • Next by Date: Re: Eudora users - Did you know that...
  • Previous by thread: Re: passing info back
  • Next by thread: Re: Sine of the times: Much better window shaker
  • Index(es):
    • Date
    • Thread