Silly Code

Someone may find this useful:

You don’t actually need to loop through all the views, maybe you just use one view and use it as a kind of cool reward for something. Or maybe not. Still, thought I’d share.

Jon

Um, what application is this supposed to work with, or is this a GUI Scripting thing?

Um, it’s code for any AppleScript Studio app which is why I posted it in this forum. :wink:

Jon

Man - every time I follow a link from macscripter.net’s front page (the direct links to recent topics), I end up saying something dumb, since I don’t realize I’m in another forum. Sorry. :slight_smile:

I did the same thing Krioni, I ran Jon’s script in SE, then posted the errors I was getting, then ended up deleting my post after I noticed which forum it was in. Doh :?

Here’s code you can run from SE. Just target any AS Studio app such as Finder Window Manager (cheap plug :wink: ):

Jon

Wow, that was one of the wierdest things I’ve seen in a while. It took the buttons and all the elements of FWM’s application window and rotated them within the interface for FWM. I’m impressed Jon :stuck_out_tongue:

A while back on the AS mailing list someone started a thread about moving windows around in the Finder, here’s one example…

on DCPSNodWindow(w, nsteps) -- David Crowe, Paul Skinner et al.
	set theDamping to 5
	set theAmplitude to 50
	set thePeriods to 10
	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 + theAmplitude * (exp (-theDamping * i / nsteps)) * (sin (i * thePeriods * pi / (nsteps)))}
		end repeat
		set position of window 1 to {xPrime, yPrime}
	end tell
end DCPSNodWindow

Pretty kewl, me thinks.

Fun for the whole family! :wink:

– Rob

Definitely cool, Greg. To get it to work, though, I had to tweak as such:

Now, if we could find a way to combine the two (spin & bounce) and make them concurrent…

Jon

They had a few of them that I thought were cool…

You play with the math to get differnet affects.

If my memory serves me well, I think the mighty Jean-Baptiste LE STANG had some input about these window shake thingies. It was a fun thread that I would enjoy seeing again

BTW, if you have ever typed in the wrong password in the login window of OS X, you’ve probably seen a sideways version of this. ;¬)

AppleScript, it never ceases to amaze me!