Created
January 27, 2015 21:14
-
-
Save jacobsalmela/020d9342f5f1797609c6 to your computer and use it in GitHub Desktop.
April fools Safari "suck" prank
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
repeat | |
tell application "System Events" to delay 3.0 | |
tell application "System Events" to set currentApp to name of first process where frontmost is true | |
if currentApp is "Safari" then | |
try | |
tell application "System Events" | |
tell process "Safari" | |
key down {shift} | |
-- Click the minimize button | |
click button 3 of window 1 | |
-- Sleep for 2 seconds to allow the animation to occur | |
delay 2.0 | |
key up {shift} | |
-- Make sure Safari is no longer the front application | |
set frontmost to false | |
set visible to false | |
end tell | |
end tell | |
end try | |
end if | |
end repeat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment