property menuBarHeight : 22 property newPosition : {0, menuBarHeight} tell application "Finder" to set {screenLeft, screenTop, screenRight, screenBottom} to bounds of window of desktop tell application "System Events" set procNames to name of every application process whose background only is false repeat with hoge in procNames tell application process hoge repeat with i from 1 to count of every window tell window i set {windowLeft, windowTop} to position set {windowWidth, windowHeight} to size if windowLeft < 0 or windowTop < menuBarHeight or (windowLeft + windowWidth) > screenRight or (windowTop + windowHeight) > screenBottom then set position to newPosition end if end tell end repeat end tell end repeat end tell