-
-
Save cantonic/1e5ff3877822296cd972 to your computer and use it in GitHub Desktop.
Bring all out of bounds Mac windows back in bounds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on run {input, parameters} | |
tell application "Finder" | |
set _bounds to get bounds of window of desktop | |
end tell | |
tell application "System Events" | |
set ids to (unix id of processes whose name is equal to "java") | |
repeat with _id in ids | |
tell (first process whose unix id is equal to _id) | |
repeat with _window from 1 to (count windows) | |
tell window _window | |
if (get first item of (get position)) is less than 0 or (get second item of (get position)) is less than 0 then | |
-- set size to {get third item of _bounds, get fourth item of _bounds} | |
set position to {get first item of _bounds, get (second item of _bounds) + 22} | |
end if | |
end tell | |
end repeat | |
end tell | |
end repeat | |
end tell | |
return input | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment