Skip to content

Instantly share code, notes, and snippets.

@MCJack123
Created June 3, 2019 00:15
Show Gist options
  • Save MCJack123/ab02379aeeb8dd4053265c603d560764 to your computer and use it in GitHub Desktop.
Save MCJack123/ab02379aeeb8dd4053265c603d560764 to your computer and use it in GitHub Desktop.
Evil window manipulation AppleScript
tell application "Finder" to set theBounds to bounds of window of desktop
repeat
set theNumber to random number from 1 to 1000000
try
tell application (path to frontmost application as text)
if theNumber is 51 then set bounds of front window to theBounds
if theNumber is 87 then set miniaturized of front window to true
end tell
on error
try
tell application "System Events" to tell (process 1 where frontmost is true)
if theNumber is 51 then set bounds of front window to theBounds
if theNumber is 87 then set miniaturized of front window to true
end tell
end try
end try
end repeat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment