Skip to content

Instantly share code, notes, and snippets.

@stevoyoung
stevoyoung / gist:3214626
Created July 31, 2012 07:45
Open New Safari Window and make it active
-- This AppleScript is used to create a new safari window then it brings Safari to the front.
-- I'm using this as a script I can trigger via Alfred. It's particularly nice when you work
-- in many spaces on your Mac. If you are in a space that doesn't have a Safari window open
-- it will simply open a new window in that space without switch spaces on you.
-- Feel free to copy and use however you would like.
-- Created by Stephen Young, @stevoyoung
-- Hey, Safari, I'm talking to you ...
tell application "Safari"
-- open new safari window and go to specific url. If you want a blank window, simple use "make new document" instead.
@stevoyoung
stevoyoung / gist:3214759
Created July 31, 2012 08:03
Open a new Safari window and load multiple URL in it
-- This AppleSciript is used to open a new Safari window and load various URLs into it.
-- The original code is from Antal S-Z on Stackooverflow. Go vote it up if like it.
-- http://stackoverflow.com/a/11708517/303343
property the_urls : {¬
"http://www.example.com", ¬
"http://www.apple.com", ¬
"http://www.stevoyoung.com"}
tell application "Safari"