home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-03-04 | 972 b | 36 lines | [TEXT/ToyS] |
- property kasJumpSize : 6 -- Should be even
-
-
- on run
- idle
- end run
-
- on idle
- tell application "Finder"
- set woze to the open windows
- set pops to the name of every window whose popup is true
- end tell
-
- set v to kasJumpSize div 2
- set j to kasJumpSize
-
- repeat with w in woze
- if (not (the same data is in w as in "Desktop")) then -- Don't dance the Desktop…
- if the number of items in (collect items of woze that match w) is 1 then -- Only if unique name
- if the number of items in (collect items of pops that match w) is 0 then -- And not a pop-up
- try
- tell application "Finder" to set wBox to reposition window w
- set dX to v - (random number from 0 to j)
- set dY to v - (random number from 0 to j)
- set wLoc to {(item 1 of wBox) + dX, (item 2 of wBox) + dY}
- tell application "Finder" to reposition window w to wLoc
- on error -- window was closed?
- end try
- end if
- end if
- end if
- end repeat
-
- return 2
- end idle
-