Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement