Advertisement
Guest User

Untitled

a guest
Jan 27th, 2015
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. repeat
  2. tell application "System Events" to delay 3.0
  3. tell application "System Events" to set currentApp to name of first process where frontmost is true
  4. if currentApp is "Safari" then
  5. try
  6. tell application "System Events"
  7.  
  8. tell process "Safari"
  9. key down {shift}
  10. -- Click the minimize button
  11. click button 3 of window 1
  12. -- Sleep for 2 seconds to allow the animation to occur
  13. delay 2.0
  14. key up {shift}
  15. -- Make sure Safari is no longer the front application
  16. set frontmost to false
  17. set visible to false
  18. end tell
  19.  
  20. end tell
  21. end try
  22. end if
  23. end repeat
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement