Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -----------------------------------------------------
- # Handler: Open Safari and minimize the window
- -----------------------------------------------------
- on theSafari(theURL)
- open location (theURL)
- delay 4 --- Because audio may not load unless you let it
- tell application "Safari"
- set miniaturized of window 1 to true
- end tell
- end theSafari
- -----------------------------------------------------
- # Close windows of certain domain, but only if Safari is running
- -----------------------------------------------------
- set tabURL to "google.com" --- Just a sample domain
- tell application "Safari"
- if it is running then
- set windowlist to windows
- repeat with i in windowlist
- set tablist to (tabs of i whose URL contains tabURL)
- repeat with a in tablist
- if (count of tablist) > 0 then
- close item 1 of tablist
- end if
- end repeat
- end repeat
- end if
- end tell
Advertisement
Add Comment
Please, Sign In to add comment